#4698: 執行逾時,怎麼改善??


asadman1523 (Jack)

學校 : 大同大學
編號 : 13361
來源 : [59.127.173.63]
最後登入時間 :
2017-02-07 16:09:22
a009. 解碼器 -- ACM 458 | From: [61.217.34.35] | 發表日期 : 2010-12-26 18:15

#include <stdio.h>
#include <string.h>

int main()
{
        int count=0,temp;
        char string[1000];
        while(getch()!=EOF){
            while(string[count]!='\0'){
                count++;
            }
           for(temp=0;temp<count;temp++){
                printf("%c",string[temp]-7);
                temp++;
            }
            printf("\n");
        }
        return 0;
    }
  
我也打了EOF了,可是還是逾時,其他討論沒看到有C語言的用法 

 
#4699: Re:執行逾時,怎麼改善??


asadman1523 (Jack)

學校 : 大同大學
編號 : 13361
來源 : [59.127.173.63]
最後登入時間 :
2017-02-07 16:09:22
a009. 解碼器 -- ACM 458 | From: [61.217.34.35] | 發表日期 : 2010-12-26 19:33

#include
#include

int main()
{
        int count=0,temp;
        char string[1000];
        while(getch()!=EOF){
            while(string[count]!='\0'){
                count++;
            }
           for(temp=0;temp
                printf("%c",string[temp]-7);
                temp++;
            }
            printf("\n");
        }
        return 0;
    }
  
我也打了EOF了,可是還是逾時,其他討論沒看到有C語言的用法 

不好意思不是getch 是gets,還是逾時
 
ZeroJudge Forum