杭电acm——1062

杭电oj 文字反转 1062 java保姆级教程 先给代码 再来详细讲解 import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner s = new Scanner(System.in); int n = s.nextInt(); int count = 0; String str = s.nextLine(); for (int i = 0 阅读详情
#include<iostream>
#include<string>
#include<cstring>
using namespace std;

int main()
{
	int N;
	cin>>N;
	getchar();
	while(N--)
	{
		int m=0;
		string str;
		getline(cin,str);
		for(int i=0;i<str.length();i++)
		{
			if(str[i]==' ')
			{
				for(int j=i-1;j>=m;j--)
				{
					cout<<str[j];
				}
				cout<<" ";
				m=i+1;
			}
		}
		for(int j=str.length()-1;j>=m;j--)
		{
			cout<<str[j];
		}
		cout<<endl;
	}
	return 0;
} 

 

杭电oj1062 c++ 题目简介: Problem Description Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them. Inp... 阅读详情

相关推荐

航电acm1062

#include<stdio.h> #include<string.h> #include<math.h> char a[1000][1000]; int main() { int i, n, m, j, len = 0; scanf("%d", &n); getchar(); for (m = 0; m < n; m++) { int s; gets(a[m]); //getchar(); len = strlen(a[m]...

qq_61343559的博客 784

杭电OJ-1062_Text Reverse

最近几天刷了些水题 HDU_OJ:    1001、2000—2011、2039、1720、1062、 输入输出格式控制 cout 精确到小数点后3位( 0也输出 ) (int) (x*100+0.5)/100.0 精确到小数点后2位,用double型乘100再转换成int,再除100.0(一定是100.0,不然结果是int型) cout 保留3位有效数字 cin>>hex>

A_yes的博客 882

杭电OJ_1062(C++版)

#include<stdio.h> #include<string.h> #include<iostream> using namespace std; int main() { int num; cin>>num; getchar(); while(num--) { char ch[1000]; int len; cin....

酱紫蛙的博客 932

杭电oj1062

#include<iostream> #include<string> using namespace std; int main() { int n; cin>>n; getchar(); string a; int k=0; while(n--) { getline(cin,a,'\n'); int b=a.size(); int s=0; for...

cjzrd的博客 279

杭电ACM1062(stack)

杭电ACM1062(stack) Problem Description Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them. Inpu...

QLSDXF的博客 645

杭电acm1062

http://acm.hdu.edu.cn/showproblem.php?pid=1062 在遇到空格或结束之前所有单词连带标点符号一起倒序输出 View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 void print(char *s,int *i) 4 { 5 char ...

anccx84886的专栏 291

杭电acm1062 Text Reverse

Text Reverse Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 34449    Accepted Submission(s): 13532 Problem Description Ignatius li

cwhong_723的博客 959

杭电ACM 1062: Text Reverse

原创作品 转载请注明出处http://blog.csdn.net/always2015/article/details/45364713这一道题不是很难,主要在于注意字符串的存取方式就成功了一大半,再者就是如何读取单个单词然后反向输出这也是关键。在输入字符串的时候我用到了getline()函数,这个函数的参数是一个输入和一个string对象,函数从给定的输入流中读入内容知道遇到换行符为止(注意换行符

去实验室,奔跑吧 4053

杭电ACM 1062

废话不说,先上题: Text Reverse Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17744Accepted Submission(s): 6730 Problem Description Ignatius li...

weixin_30814223的博客 88

杭电acm1062Text Reverse

给一个我没注意到的输入样例吧。 1 abc def p//单词之间超多空格 #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include<cstdlib> using namespace std; int main() { int t; char s[1005],...

死也不承认自己笨的博客 212

杭电oj1062题c语言答案,ACM解题报告搜索 hdoj/hdu

hdoj1001 hdoj1002 hdoj1003 hdoj1004 hdoj1005 hdoj1006hdoj1007 hdoj1008 hdoj1009 hdoj1010 hdoj1011 hdoj1012 hdoj1013hdoj1014 hdoj1015 hdoj1016 hdoj1017 hdoj1018 hdoj1019 hdoj1020hdoj1021 hdoj1022 hdoj1...

weixin_29317963的博客 1103

杭电acm刷题(3):1062,Text Reverse

Problem Description Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them. Input The input co

hongbin_xu的博客 819

杭电acm刷题(3):1062,Text Reverse ...

Problem Description Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them. Inp...

weixin_30586085的博客 196

杭电1062(顺序栈)

Input The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case contains a single line with severa...

weixin_45725137的博客 259

杭电1062

/*********************************  *    日期:2011-3-5  *    作者:SJF  *    题号:杭电1062  *    题目:Text Reverse  *    结果:AC  *    总结:   **********************************/ #include #include int m

落日小屋 1729
下一篇: 杭电acm——1034
AdventL
博客等级 码龄9年 8粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值