- #include<reg51.h>
- #include<stdio.h>
- #include<string.h>
- struct people
- {
- char name[8];
- int score;
- };
- struct people tmp;
- void main()
- {
- struct people xdata p[5];
- unsigned char count=0;
- for(count=0;count<=4;count++)
- {
- scanf("%s,%d",&p[count].name,&p[count].score);
- }
- unsigned char a,b;
- for(a=0;a<=4;a++)
-
- for(b=3;b>=a;b--)
- {
- if(p[b+1].score>p[b].score)
- {
- strcpy(tmp.name,p[b+1].name);
- tmp.score=p[b+1].score;
- strcpy(p[b+1].name,p[b].name);
- p[b+1].score=p[b].score;
- strcpy(p[b].name,tmp.name);
- p[b].score=tmp.score;
- }
- }
-
-
- }
复制代码一直显示
- Build target 'Target 1'
- compiling new.c...
- NEW.C(19): error C141: syntax error near 'unsigned'
- NEW.C(19): error C202: 'a': undefined identifier
- NEW.C(20): error C202: 'a': undefined identifier
- NEW.C(22): error C202: 'b': undefined identifier
- NEW.C(24): error C202: 'b': undefined identifier
- NEW.C(26): error C202: 'b': undefined identifier
- NEW.C(27): error C202: 'b': undefined identifier
- NEW.C(28): error C202: 'b': undefined identifier
- NEW.C(29): error C202: 'b': undefined identifier
- NEW.C(30): error C202: 'b': undefined identifier
- NEW.C(31): error C202: 'b': undefined identifier
- Target not created
复制代码
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
怎么有这么奇葩的问题。。。你确定那是单片机的书。。。单片机主要是做控制的。。。这种问题我从来没遇到过。。。不可能用单片机做。。。建议你去看看单片机的硬件。。。
一周热门 更多>