Home > database >  About the high key out
About the high key out

Time:10-07


1:
#include
Int main ()
{
Int n, a; * *//n is the number of input, assuming that n=123456 * *
scanf("%d",& n);
a=0;
While (n> 0)
{
A=a * 10 + n % 10; * *//n output in reverse chronological order, after the first while loop is a, a=654321 * *
N=n/10;
}
While (a!=0)
{
Printf (" % d ", a % 10); 4
A=a/10;
}
/* * * a into the second while loop, when a is not equal to zero, loops, each loop output take more than a number, to a processing, in the final output 1, 2, 3, 4, 5 and 6 */* *
return 0;
}

2:
#include
Int main ()
{
Int n, a, b;
scanf("%d",& n); * *//n is the number of input, if n is 123456 * *
A=n;
B=1;
While (a> 9)
{
A/=10;
B *=10;
}
* *//this while loop for statistical n digits, or by b * *
While (b> 0)
{
Printf (" % d ", n/b); * *//in turn directly from the high to print out 1 2 3 4 5 6 * *
N %=b;
B/=10;
}
printf("\n");
return 0;
}

3:
#include
Int main () {
Char n;//* * * * with the method of the string
While (1) {
The scanf (" % c ", & amp; n);
If (n=='\ n') break;
Printf (" % c, n);
}
return 0;
}

4:
#include
Int main () {
Char n;
While (the scanf (" % c ", & amp; N)! EOF)={* *//EOF at the end of the file is not * *
If (n=='\ n') break;
Printf (" % c, n);
}
return 0;
}
  • Related