幻影学霸刘 @ 2020-04-21 19:17:59
求各位大佬告诉我怎样才能不输出换行,谢谢
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
int main()
{
char c[128];
cin.getline(c,128);
for(int i=strlen(c)-1;i>=0;i--)
{
if((c[i]<'0'&&c[i]>'9')&&c[i]!='.') continue;
cout<<c[i];
}
return 0;
}
by 灵光一闪 @ 2020-04-21 19:20:49
@幻影学霸刘 if((c[i]<'0'&&c[i]>'9')&&c[i]!='.') continue;
删了
by 灵光一闪 @ 2020-04-21 19:21:32
还有string
不香么
by TKater_yzt @ 2020-04-21 19:32:47
直接用string它不香么?
string st;
cin>>st;
for(int i=st.size()-1;i>=0;i--)cout<<st[i];
by ⚡zhangjingcan⚡ @ 2020-04-21 19:46:16
@幻影学霸刘 不需要用cin.getline
by Unordered_OIer @ 2020-04-21 20:30:08
by T1anBooy @ 2020-04-23 10:05:13
直接反转字符就可以了,没必要加特判,也可以输入的时候就是倒着输入的,直接输出就行了%%%
by 幻影学霸刘 @ 2020-04-24 17:36:45
谢谢各位大佬们
by 幻影学霸刘 @ 2020-04-24 17:37:47
@天梦丶天幕 你来干啥
by 幻影学霸刘 @ 2020-04-24 17:38:15
@天梦丶天幕 你是怎么知道我发帖的
by T1anBooy @ 2020-04-25 14:12:44
@幻影学霸刘 冒个泡