6837 | 2023-12-19 10:49:01 | HunMartin23 | Decimália | cpp17 | Compilation error |
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int N,osz=0,l=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
{
l=0;
i=osz-db;
while (l!=2 || i!=0)
{
a=i%10;
i=i/10;
if (a!=0)
l++;
}
i=osz-db;
db++;
}while (l!=1||l!=0);
cout<<osz-i;
return 0;
}
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