6832 2023. 12. 19 10:47:56 HunMartin23 Decimália cpp17 Forditási hiba
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int N,osz=0,lehet=0,a,db=0;;
    cin>>N;
    int d[N];
    for (int i=1;i<=N;i++)
    {
        cin>>d[i];
        osz+=d*10*i;
    }
    int i=osz;
    do
    {
        lehet=0;
        i=osz-db;
        while (lehet!=2 || i!=0)
        {
            a=i%10;
            i=i/10;
            if (a!=0)
                lehet++;
        }
        i=osz-db;
        db++;

    }while (lehet!=1||lehet!=0);
    cout<<osz-i;
    return 0;
}
Forditási hiba
exit status 1
main.cpp: In function 'int main()':
main.cpp:13:15: error: invalid operands of types 'int [N]' and 'int' to binary 'operator*'
   13 |         osz+=d*10*i;
      |              ~^~~
      |              | |
      |              | int
      |              int [N]
Exited with error status 1