C的源码,应该到C论坛去呀,至少应该给出Pascal的代码吧。

解决方案 »

  1.   

        program  oue(input,output);
    var chinput :char;
    begin   
     read(chinput);  
    while  chinput<>'q' do
    begin
        write('chenfeng3000');
        read(chinput);
    end
        
    end.
       Jiker 就算是Pascal 代码也是有问题啊!刚才c论坛的朋友已经给出了答案 原因是
    scanf("%c",&chinput); 在回车我给了两个字符,所以循环当然作了两次,包括哪个回车
    符,我想问问 pascal是怎样解决这个空格or回车符占位的问题 
      

  2.   

    在每个scanf语句后面添一句getchar()
      

  3.   

    这样行不行?#include <conio.h>void main() {
      int  x31=0;
      char chinput;  printf("\n");
      do {
        chinput=getch();
        if (chinput!='q')
          printf("%c\nx=%d\n",chinput,x31++);
        else
          printf("%c\n",chinput);
      } while(chinput!='q');
    }
      

  4.   

    #include <stdio.h>
    int main()
    {
    int  x31=0;
    char chinput;
    scanf("%c",&chinput);
    for(;chinput!='q';)
    {
    printf("x=%d\n",x31++);
    scanf("%1s",&chinput);
    }
    return 0;
    }哈哈快给分;)
      

  5.   

    // the file is used to answer question on csdn
    #include <stdio.h>
    int main()
    {
    int  x31=0;
    char chinput;
    scanf("%c",&chinput);
    for(;chinput!='q';)
    {
    printf("x=%d\n",x31++);
    scanf("%1s",&chinput);
    }
    return 0;
    }//快给分;)