#5093: 可否幫幫我?(WA)


wuchonson (一WS神教o無用(進建中記得加資訊))


程式碼看似沒有問題

但每一次測試答案最後面會多出一個星號

 而放上去的結果卻是......

與正確輸出不相符(line:1)
您的答案為: *CDC is the trademark of the Control Data Corporation.*IBM ...略
正確答案為: *CDC is the trademark of the Control Data Corporation.

可否幫幫忙?

程式碼:

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    char c;
    do{
       cin.get(c);
       c-=7;
       cout << c; 
    }while(!cin.fail());
   
 

        return EXIT_SUCCESS;
}

謝謝

 

#5113: Re:可否幫幫我?(WA)


ray57diary79 (無)


程式碼看似沒有問題

但每一次測試答案最後面會多出一個星號

 而放上去的結果卻是......

與正確輸出不相符(line:1)
您的答案為: *CDC is the trademark of the Control Data Corporation.*IBM ...略
正確答案為: *CDC is the trademark of the Control Data Corporation

cin.get(c)  沒有處理換行字元'\n',所以後面有亂碼