C语言函数分析英语单词学习记录 - 计算背单词数量超过指定值的天数
#include <stdio.h> #include <string.h>
int analysis(int x) { int count = 0; // 记录超过x的天数 int num; // 当天背的单词数量 char word[101]; // 存储单词 while (1) { scanf('%d', &num); if (num == -1) { break; } if (num > x) { count++; } for (int i = 0; i < num; i++) { scanf('%s', word); } } return count; }
// Program: int main() { int x; scanf('%d', &x); int result = analysis(x); printf('%d', result); return 0; } // End
原文地址: https://www.cveoy.top/t/topic/oEv2 著作权归作者所有。请勿转载和采集!