杭电1062Text Reverse

[复制链接]
查看11 | 回复2 | 2011-1-26 19:54:06 | 显示全部楼层 |阅读模式
#include
#include
void fun( char *p){

char*q =p+strlen(p)-1, t;

while( p = 0; i-- )

{

if( !i ) printf("%c", a[0] );

if( a == ' '||i==0 )

{j = i+1;

while( a[j] != ' ' && a[j]!= '\0' )

printf("%c", a[j++] );

if(i) printf(" ");

}

}

printf("\n");
}
// system("pause");

return 0;
}
为什么老是PE呢,,格式要求没找出错误啊
题目地址 http://acm.hdu.edu.cn/showproblem.php?pid=1062

回复

使用道具 举报

千问 | 2011-1-26 19:54:06 | 显示全部楼层
abc cba
(测试数据。。)我AC代码,供参考。。#include#includevoid main(){
int n,i,k,j,c,d,m;
char a[1000],b[1000];
scanf("%d",&n);
scanf("%*c");
while(n--)
{
k=0;
gets(a);
for(i=0;a!='\0';i++)
回复

使用道具 举报

千问 | 2011-1-26 19:54:06 | 显示全部楼层
给你一组测试数据:ko teg ti
(注意后面有十个空格,空格也是需要的)。后面是AC代码。import java.util.Scanner;public class Main{ public static void main(String[] args) {
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行