initial import
[staff/goc4/2018bti7061.git] / c-2-controlStructures / examples / inputsoutputs / sscanf.c
1 #include <stdio.h>
2 /* Usage:
3 ./sscanf < input.txt
4 */
5 main(){
6
7 char line[256];
8 int i=0;
9 int a,b,c,d;
10 while(gets(line)){
11 int i = sscanf(line,"%d %d %d %d",&a,&b,&c,&d);
12 printf("%d + %d + %d + %d = %d\n",a,b,c,d,(a+b+c+d));
13
14 printf("(nb of match %d)\n",i);
15 }
16
17
18
19
20 }