zoukankan      html  css  js  c++  java
  • CODE[VS] 1205 单词翻转

    题目描述 Description

    给出一个英语句子,希望你把句子里的单词顺序都翻转过来

    输入描述 Input Description

    输入包括一个英语句子。

    输出描述 Output Description

    按单词的顺序把单词倒序输出

    样例输入 Sample Input

    I love you

    样例输出 Sample Output

    you love I

    数据范围及提示 Data Size & Hint

    简单的字符串操作

    我真的是太不擅长字符串了。。

    关于字符串的操作也太多了吧。。。

    ac代码

     1 #include<iostream>
     2 #include<cstdio>
     3 #include<cmath>
     4 #include<algorithm>
     5 #include<cstring>
     6 using namespace std;
     7 
     8 string a[102];
     9 int i;
    10 
    11 int main()
    12 {
    13     while(cin>>a[i])
    14     {
    15         ++i;
    16     }
    17     for(int j=i-1;j>=0;--j)
    18         cout<<a[j]<<" ";
    19     return 0;
    20 }
  • 相关阅读:
    Fibonacci Again
    N的10000的阶乘
    HDU2141(二分搜索)
    POJ2366(HASH法)
    10106 Product
    UVA 401 Palindromes
    UVA424 Integer Inquiry
    POJ2503(二分搜索)
    mysql重置root密码
    tidb安装haproxy负载均衡
  • 原文地址:https://www.cnblogs.com/Mary-Sue/p/9137913.html
Copyright © 2011-2022 走看看