蒻蒟求助全WA

P5705 【深基2.例7】数字反转

In_blue @ 2020-04-26 12:55:04

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string c;
    getline(cin,c);
    for(int i=c.size()-1;i>=0;i--)putchar(c[i]);
    return 0;
}

请问哪里错了(求大佬指教)


by hulean @ 2020-04-26 12:58:28

@WaiN 你去洛谷IDE里试试看

有些东西本地运行和洛谷不一样


by hulean @ 2020-04-26 12:58:56

尤其是字符串读入类的


by lzqy_ @ 2020-04-26 12:59:40

把getline改成cin试试?


by lzqy_ @ 2020-04-26 13:00:05

getline可能会多输出一些奇奇怪怪的东西


by lzqy_ @ 2020-04-26 13:00:13

@WaiN


by lzqy_ @ 2020-04-26 13:02:15

我试过了,改成cin就可以过了


by In_blue @ 2020-04-27 12:02:44

@hulean 感谢机房大佬


by In_blue @ 2020-04-27 12:03:15

@栾竹清影 thanks you very much


|