The obstacle here is to find a number with the same decimals and do some math with them.
What I want to achieve here is just to make the switch/case statement work.
I just started programming (ಥ_ಥ)
What did I do wrong here?
I can't find the issue with the logic...
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, add[5]={0};
for(int i=1; i<=10000; i++){
switch(i)
case 1:
add[0]+=i;
break;
case 10:
add[1]+=i;
break;
case 100:
add[2]+=i;
break;
case 1000:
add[3]+=i;
break;
case 10000:
add[4]+=i;
break;
}
cout<<add[0]<<"\n"<<add[1]<<"\n"<<add[2]<<"\n"<<add[3]<<"\n"<<add[4]<<"\n";
return 0;
}