+ 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; }
4 Respostas
+ 2
"but the question is how we can make a rule that does not sho"
that doesn't ring me any bells
+ 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)"
0
That's true Michał Doruch ,i mean that.