1 //input A, B, output a+b2 /*#include <stdio.h>3 int main ()4 {5 int A, b;6 scanf ("%d%d", &a,&b);7 printf ("%d", a+b);8 }*/9 /*Ten //Enter a character to return his ASCLL code One #include <stdio.h> A int main () - { - char A; the scanf ("%c", &a); - printf ("%d", a); - }*/ - + -#include <stdio.h> + intMain () A { at CharA; - Charb; - while(scanf ("%c%c", &a,&b)!=eof)//when there is a space in the middle, the input parameters should also have a space, when there is no space, you do not have to enter a space. - { -printf ("%d\t", a); -printf ("%d", b); in } - } to + /*** - * * Usage of Switch the */ * /* $ #include <stdio.h>Panax Notoginseng int main () - { the int A; + while (scanf ("%d", &a)!=eof) A { the switch (a) + { - Case (1): {//His grandmother's original to add a colon $ printf ("a=1\n"); $ Break ; - } - Case (2): { the printf ("a=2\n"); - Break ;Wuyi } the default:{ - printf ("Not 1 nor 2\n"); Wu Break ; - } About } $ } - }*/
C Language Basic grammar, over the array can re-write some algorithms and data structures