题解 | #提取不重复的整数#用vector建了一个hash表

提取不重复的整数

http://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1

#include #include #include using namespace std;

int main(){ string str; cin>>str; vector h(10,0); int n = str.length(); for(int i = n-1;i >= 0;i--){ if(h[str[i]] == 0){ cout<<str[i]; h[str[i]] = 1; } } }

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务