请各位大神赐教 百分制转化五分制
我想实现百分制到五分制的转换,我这个总是有错误#include <iostream.h>
using namespace std;
void main()
{ int old_grade[10]=100,92,72,83,49,71;
int i
for(i=0;i<10;i++)
cout<<TranGrade(grade[i])<<endl;
}
int TranGrade(int old_grade)
{int new_grade;
switch(old_grade/10)
{
case 10:
case 9:
new_grade=1;
break;
case 8:
new_grade=2;
break;
case 7:
new_grade=3;
break;
case 6:
new_grade=4;
break;
default:
new_grade=5;