for
#include<iostream>using namespace std;
main()
{
int stu = {{87,96,70},{68,87,90},{94,100,90},
{100,81,82},{83,65,85},{78,87,65},
{85,75,83},{91,94,100},{76,72,84},{87,93,73}
};
int fre = {0};
for(int q = 0;q <= 10;q++)
{
cout<<fre<<endl;
}
for(int i = 0 ;i <= 9;i++)
{
for(int x = 0 ;x <= 9;x++)
{
for(int y = 0;y <=2;y++)
{
if ((i*10 <= stu) && (stu <= i*10 +9))
{
++fre;
cout<<"+1";
}
if (stu == 100)
{
++fre;cout<<"+2";
}
}
}
}
for(int q = 0;q <= 10;q++)
{
cout<<fre<<endl;
}
}
为啥输出fre是30 #include<iostream>
using namespace std;
main()
{
int stu = {{87,96,70},{68,87,90},{94,100,90},
{100,81,82},{83,65,85},{78,87,65},
{85,75,83},{91,94,100},{76,72,84},{87,93,73}
};
int fre = {0};
for(int q = 0;q <= 10;q++)
{
cout<<fre<<endl;
}
for(int x = 0 ;x <= 9;x++)
{
for(int y = 0;y <=2;y++)
{
int k=stu/10;
fre++;
if (k<10)
{
cout<<"+1";
}
if (k==10)
{
cout<<"+2";
}
}
}
for(int q = 0;q <= 10;q++)
{
cout<<fre<<endl;
}
} 起飞飞飞飞飞~ 发表于 2020-10-29 17:37
#include
using namespace std;
这样写可以原本哪错了 liangmeisheng 发表于 2020-10-29 17:47
这样写可以原本哪错了
我知道了
页:
[1]