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


asadman1523 (Jack)


#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)


#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,還是逾時