+ 1

how i can make a rule that does not show 20,30.. 40's reverse because their reverse are like 03 and ...

#include <iostream> using namespace std; int main() { int s,n,a,i; for(i=11;i<=99;i++) { n=i; s=0; cout<<n<<":"; while(n>0){ a=n%10; s=s*10+a; n=n/10; } cout<<s<<endl; } return 0; }

21st Apr 2021, 11:27 AM
Nariman Tajari
Nariman Tajari - avatar
4 Antworten
+ 2
"but the question is how we can make a rule that does not sho" that doesn't ring me any bells
21st Apr 2021, 12:14 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 1
You mean, how to skip 20, 30 etc? You can use if statement: if(!(i%10)) continue; Which is the same as "if (i%10==0)"
21st Apr 2021, 1:40 PM
Michal Doruch
0
That's true Michał Doruch ,i mean that.
21st Apr 2021, 3:43 PM
Nariman Tajari
Nariman Tajari - avatar