C Primer Plus编程练习答案(Chapter7)

7.12.1

#include
int main() {
int score1 = 0, score2 = 0, score3 = 0;
char ch;

printf("Please enter strings(enter'#'to quit): ");
scanf_s("%c", &ch);
while (ch != '#') {
if (ch == ' ')
score1++;
else if (ch == '/n')
score2++;
else
score3++;
scanf_s("%c", &ch);
}
printf("/nDone./n");
printf("There %d blank %d enter and %d chars", score1, score2, score3);

return 0;
}
 7.12.2

#include
int main() {
char ch;
int score = 0;

C Primer Plus编程练习答案(Chapter7)最先出现在Python成神之路

版权声明:
作者:主机优惠
链接:https://www.techfm.club/p/11968.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>