Home > Back-end >  To solve the
To solve the

Time:11-28

C how to input as required
[4:3:1]
[5:3:1]
[6:4:3]
[6:9:1] such a format

CodePudding user response:

Int a, b, c;
The scanf (" % d: % d: % d] ", & amp; A, & amp; B, & amp; C);

CodePudding user response:

Your demand for detail

CodePudding user response:

reference 2 building self-confidence boy reply:
your demand in detail some

#include

Int main ()
{
Int t;
The scanf (" % d ", & amp; T);
for(int i=0; i{
int n; Char s [100];
The scanf (" % s ", s);
The scanf (" % d ", & amp; N);
For (int p=0; p{
int a,b,c;
The scanf (" % d: % d: % d] ", & amp; A, & amp; B, & amp; C);
Printf (" % d % d % d ", a, b, c);
}
}
return 0;
}
This not line, the output of a, b, c is not correct

CodePudding user response:

 [% d: % d: % d] 

Pay attention to the format of the input is the need to have in [] [] also need to have: colon, also want to pay attention to the colon in both Chinese and English, namely the scanf in the colon is in Chinese, the contents of the input with a colon also needs are in Chinese, and vice should be input in English, with is English

 the scanf (" % s ", s); 

Input this is stem what of? Without the use of s?

reference Aa_1z reply: 3/f
Quote: refer to the second floor confident boy reply:
your demand in detail some

#include

Int main ()
{
Int t;
The scanf (" % d ", & amp; T);
for(int i=0; i{
int n; Char s [100];
The scanf (" % s ", s);
The scanf (" % d ", & amp; N);
For (int p=0; p{
int a,b,c;
The scanf (" % d: % d: % d] ", & amp; A, & amp; B, & amp; C);
Printf (" % d % d % d ", a, b, c);
}
}
return 0;
}
This not line, the output of a, b, c not

CodePudding user response:

It is part of a topic, you run it, after losing the n to directly output a bunch of random Numbers
  • Related