做出了实际意义的小程序,帮助学院处理繁琐(落后)的工作。
//求一堆数的平均值
int main(){
float avr,x;
float sum=0;
int p = 0;
int i = 0;
while (cin>>x)
{
sum += x;
p++;
}
avr = sum / p;
cout << avr;
return 0;
}//求一堆数的平均值
//表格计数统计 14X
/*
int main() {
char m;
int x = 4, y = 14;
int a[15][6] = { 0 };
long long int q = 0;
int jj = 0;
cout << "1!!!!!!!!!!!!!!!!!!!!!!" << endl;
while (cin >> q) {
jj++;
for (int i = 0; i < 14; i++) {
cout << "next roud" << i + 1 << endl;
if (cin >> m) {
switch (m)
{
case '1':
a[i][0]++;
break;
case '2':
a[i][1]++;
break;
case '3':
a[i][2]++;
break;
case '4':
a[i][3]++;
break;
}
}
}
cout << "next page" << endl;
}
for (int i = 0; i < 14; i++) {
for (int j = 0; j < 4; j++) {
cout << a[i][j] << '\t';
}
cout << endl;
}
cout << "num:" << jj-1 << endl;
return 0;
}
*/