#148: 看不懂錯誤訊息@@


unk258 (hahaha)


用dev c++測沒問題

但是丟上來後一直都是WA

錯誤訊息是

您的答案為: *CDC is the trademark of the Control Data Corporation.�
正確答案為: *CDC is the trademark of the Control Data Corporation.

請問一下在我的答案最後的  �   是甚麼意思呢???

麻煩解答了~感謝 ^^

#149: Re:看不懂錯誤訊息@@


looser (looser)


用dev c++測沒問題

但是丟上來後一直都是WA

錯誤訊息是

您的答案為: *CDC is the trademark of the Control Data Corporation.�正確答案為: *CDC is the trademark of the Control Data Corporation.

請問一下在我的答案最後的  �   是甚麼意思呢???

麻煩解答了~感謝 ^^

印出亂碼了~不知道怎麼出現髒字元.沒看到你的寫法也不知道怎麼產生.

#150: Re:看不懂錯誤訊息@@


unk258 (hahaha)


我的程式碼

#include <iostream>
#include <cstring>
using namespace std;

int main()

   do
   {
      char input[999];
      int size = 0; 
      cin.get(input,999);     //把輸入的字元存到input中
      while(input[size] != '\0')size++;
  
      //把字元轉成ascii
      for(int i=0;i<=size;i++)
      {
         input[i] += -7;
         cout << input[i];
      }
      cout << endl;
   }while(cin.get() != EOF);
   //system("pause");
   return 0;
}

搞不懂為甚麼會有亂碼出現@@

麻煩各位幫我解答了~感謝 ^^

#151: Re:看不懂錯誤訊息@@


su_horng (su_horng)


      for(int i=0;i<=size;i++)
      {

改成for(int i=0; i<size; i++)試試看
#152: Re:看不懂錯誤訊息@@


unk258 (hahaha)


      for(int i=0;i<=size;i++)      {

改成for(int i=0; i<size; i++)試試看




可以了!!

感謝su_horng   ^^

#2816: Re:看不懂錯誤訊息@@


a50525004 (ooone)


while(input[size] != '\0')size++;
我搞不懂這邊在幹嘛 請哪位大大幫我解說@@

#2817: Re:看不懂錯誤訊息@@


example (學姊)


while(input[size] != '\0')size++;
我搞不懂這邊在幹嘛 請哪位大大幫我解說@@


 '/0' 是字串的結尾符號

 while( input[size] != '/0' ) size++;

 這行是指 當 input[size] (此字元) 不為結尾( '/0' )時進入迴圈,size++

 那整行就是在算 input 進來的長度

#2818: Re:看不懂錯誤訊息@@


david942j (文旋)


while(input[size] != '\0')size++;
我搞不懂這邊在幹嘛 請哪位大大幫我解說@@


 '/0' 是字串的結尾符號

 while( input[size] != '/0' ) size++;

 這行是指 當 input[size] (此字元) 不為結尾( '/0' )時進入迴圈,size++

 那整行就是在算 input 進來的長度

 

樓上的打錯嚕 是'\0'不是'/0'

#2820: Re:看不懂錯誤訊息@@


example (學姊)


while(input[size] != '\0')size++;
我搞不懂這邊在幹嘛 請哪位大大幫我解說@@


 '/0' 是字串的結尾符號

 while( input[size] != '/0' ) size++;

 這行是指 當 input[size] (此字元) 不為結尾( '/0' )時進入迴圈,size++

 那整行就是在算 input 進來的長度

 

樓上的打錯嚕 是'\0'不是'/0'

 sorry @@

 我這麼一看也覺得怪怪XD

#2839: Re:看不懂錯誤訊息@@


a50525004 (ooone)


while(input[size] != '\0')size++;
我搞不懂這邊在幹嘛 請哪位大大幫我解說@@


 '/0' 是字串的結尾符號

 while( input[size] != '/0' ) size++;

 這行是指 當 input[size] (此字元) 不為結尾( '/0' )時進入迴圈,size++

 那整行就是在算 input 進來的長度

 

感謝你們啦!!! 大心