490 - Rotating Sentences
来源:互联网 发布:bp网络和神经网络区别 编辑:程序博客网 时间:2024/04/30 17:23
由于数组越界,出现了RE。由于忘了在有的行尾加空格,WA了,于是把数组直接全部初始化成空格字符。唉……
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char map[105][105];
int main(void)
{
memset(map,' ',sizeof(map));
int j = 104,i = 0,max = 0;
char ch;
while ((int)(ch = getchar()) != EOF)
{
if(ch == '/n')
{
j--;
i = 0;
}
else
{
map[i][j] = ch;
i++;
}
if(max < i) max = i;
}
int k ;
for(i = 0 ;i < max; i++)
{
for(k=j+1;k< 105;k++)
{
printf("%c",map[i][k]);
}
printf("/n");
}
return 0;
}
- 490 - Rotating Sentences
- uvaoj 490 - Rotating Sentences
- Uva 490 Rotating Sentences
- UVa 490 - Rotating Sentences
- UVA-490-Rotating Sentences
- 490 - Rotating Sentences
- UVaOJ 490 - Rotating Sentences
- 490 - Rotating Sentences
- UVa 490 - Rotating Sentences
- UVA 490 - Rotating Sentences
- UVa 490 - Rotating Sentences
- 490 - Rotating Sentences
- 490 - Rotating Sentences
- UVa:490 - Rotating Sentences
- 490 - Rotating Sentences
- UVA 490 Rotating Sentences
- UVA:490 - Rotating Sentences
- 490 - Rotating Sentences
- ubuntu10.04安装JDK5
- 软件架构师分类及能力归纳
- Apache vs nginx vs lighttpd
- 494 - Kindergarten Counting Game
- 414 - Machined Surfaces
- 490 - Rotating Sentences
- linux内核链表
- VC6.0与Visio冲突问题解决方案
- stl 关于erase,remove,元素删除
- C++中const的用法详解
- sql 小悟
- ubuntu9.10和ubuntu10.X下eclipse3.4不能运行解决方法
- 管理Activity的实例
- 程序员谈谈我的职场观(三)