Knowledge point:
Understand the programming sequence and use scanf () flexibly ()
Int A [1000], I, m = 1; char B [1000]; for (I = 0; I <1000; I ++) {scanf ("% d ", & A [I]); scanf ("% C", & B [I]);
The ascll code ending with the Space key is 010. The ascll code of the original carriage return key is 13, but in the program press the carriage return key is a line feed, so the ascll code of the line feed is used to control the end of the program.
If (B [I]! = 10)
Tip: use integer Array Operations to stop character array control
Content: select the maximum number from N.
Input description:
One row, multiple integers, separated by Spaces
Output description:
Two integers. The first is the total number of digits, and the second is the maximum number. Separated by Spaces
Input example:
1 2 3 4 5 9 6
Output example:
7 9
#include <stdio.h>int main(){ int a[1000],i,m=1; char b[1000]; for (i=0;;i++) { scanf("%d",&a[i]); scanf("%c",&b[i]); if(a[0]<a[i]) { a[0]=a[i]; } if (b[i]!=10) { m+=1; } else { break; } } printf("%d %d\n",m,a[0]); return 0;}
(Syntax) Select the largest number from N (change)