求助!!!难以名状的神奇错误
查看原帖
求助!!!难以名状的神奇错误
1152016
Spirit_ZeroHeart楼主2023/11/28 16:45

emmm难以名状的错误 同一个代码,每次提交结果都不一样(我快速重按提交评测),结果只有两个,要么RE,要么AC.基本上每次都是2个点AC,而且每次AC的点都不一样.简直是闹鬼了

#include<string.h>
int main()
{
    int a=0,b=0,c=0,end=0;
    char s[256],ch,cont;
    fgets(s,255,stdin);
    int j=0;
    while(s[end]!='\n')
    {
    	ch=s[end];
    	end+=3;
    	cont=s[end];
    	end+=2;
    	if(ch=='a')
    	{
    		switch(cont)
    		{
        		case 'a':a=a;break;
        		case 'b':a=b;break;
        		case 'c':a=c;break;
        		case '0':a=0;break;
        		case '1':a=1;break;
        		case '2':a=2;break;
        		case '3':a=3;break;
        		case '4':a=4;break;
        		case '5':a=5;break;
        		case '6':a=6;break;
        		case '7':a=7;break;
        		case '8':a=8;break;
        		case '9':a=9;break;
    		}
    	}
    	if(ch=='b')
    	{
    		switch(cont)
    	    {
        	case 'a':b=a;break;
        	case 'b':b=b;break;
        	case 'c':b=c;break;
        	case '0':b=0;break;
        	case '1':b=1;break;
        	case '2':b=2;break;
        	case '3':b=3;break;
        	case '4':b=4;break;
        	case '5':b=5;break;
        	case '6':b=6;break;
        	case '7':b=7;break;
        	case '8':b=8;break;
        	case '9':b=9;break;
    	    }
        }
    	if(ch=='c')
    	{
    		switch(cont)
    	    {
        	case 'a':c=a;break;
        	case 'b':c=b;break;
        	case 'c':c=c;break;
        	case '0':c=0;break;
        	case '1':c=1;break;
        	case '2':c=2;break;
        	case '3':c=3;break;
        	case '4':c=4;break;
        	case '5':c=5;break;
        	case '6':c=6;break;
        	case '7':c=7;break;
        	case '8':c=8;break;
        	case '9':c=9;break;
    	    }
    	}
   	
    }
    printf("%d %d %d",a,b,c);
    return 0;
}
有无大佬能帮帮我(哭)
2023/11/28 16:45
加载中...