International practice OJ The first way is A+b bar. It is said that in order to adapt to various OJ compilers. Sorted out some common standard input and output
1#include <stdio.h>//a set of data roll rough2 3 intMain ()4 {5 intA, B;6scanf"%d%d", &a, &B);7printf"%d\n", A +B);8 return 0;9 }Ten One#include <stdio.h>//multiple sets of data do not end A - intMain () - { the intA, B; - while(SCANF ("%d%d", &a, &b)! =EOF) { -printf"%d\n", A +B); - } + return 0; - } + A#include <stdio.h>//Number of Groups + multiple sets of data at - intMain () - { - intA, B, N, I; -scanf"%d", &n); - for(i=0; i<n;i++){ inscanf"%d%d", &a, &B); -printf"%d\n", A +B); to } + return 0; - } the *#include <stdio.h>//with 0 End $ Panax Notoginseng intMain () - { the intA, B, N, I; + while(SCANF ("%d%d", &a, &b) && (a!=0&&b!=0)){ Aprintf"%d\n", A +B); the } + return 0; - } $ $#include <stdio.h>//0 0 End - - intMain () the { - intA, B, N, I;Wuyi while(SCANF ("%d%d", &a, &b) && (a!=0|| b!=0)){ theprintf"%d\n", A +B); - } Wu return 0; -}
T001 a+b (with common standard input and output)