65,187
社区成员




void Chapter_6::func_2()
{
double ipt[10] = {0};
double average;
double sum = 0;
int iptnum = 0;
int count = 0;
cin >> ipt[iptnum];
while(!isdigit(ipt[iptnum]))
{
sum += ipt[iptnum];
iptnum++;
if(10 == iptnum)
break;
cin >> ipt[iptnum];
}
average = sum/iptnum;
for(int i = 0; i < iptnum; i++)
{
if(ipt[i] > average)
count++;
cout << ipt[i] << ' ';
}
cout << "\nthe iptnum: " << iptnum;
cout << "\nthe average is " << average << " and there are " << count << " digiter(s) is(are) bigger than the average.";
}
int main()
{
int test = 1;
char test1 = 'b';
cout << "input an int: ";
cin >> test;
cout << "\ninput a char: ";
cin >> test1;
cout << "\nint: " << test << ' ' << "char: " << test1;
return 0;
}
结果是他根本不给我第二次输入的机会...
int main()
{
int test = 1;
char test1 = 'b';
cout << "input an int: ";
cin >> test;
cout << "\ninput a char: ";
cin >> test1;
cout << "\nint: " << test << ' ' << "char: " << test1;
return 0;
}
结果是他根本不给我第二次输入的机会...
int main()
{
int test = 1;
char test1 = 'b';
cout << "input an int: ";
cin >> test;
cout << "\ninput a char: ";
cin >> test1;
cout << "\nint: " << test << ' ' << "char: " << test1;
return 0;
}
结果是他根本不给我第二次输入的机会...
int main()
{
int test = 1;
char test1 = 'b';
cout << "input an int: ";
cin >> test;
cout << "\ninput a char: ";
cin >> test1;
cout << "\nint: " << test << ' ' << "char: " << test1;
return 0;
}