Welcome To SDIBT ACM-ICPC Online Judge

VIRTUAL JUDGE Recent Contest F.A.Qs Discuss Home ProblemSet Status Ranklist 2 Contest LoginRegister Exam
SDIBT Online Judge WebBoard
[ New Thread ]
MainBoard >> ACM 输入输出
xiao @ 2011-11-07 21:08:38
[ Quote ] [ Edit ] [ Delete ] 1#
http://blog.csdn.net/ll365594480/article/details/6406998
xiao @ 2011-12-04 07:08:50
[ Quote ] [ Edit ] [ Delete ] 2#
使用剪贴板对于多组测试数据或者比较长的测试数据就会显得不那么好用了。而使用输入输出的重定向则会更方便。

输入输出重定向是在终端窗口下的一种命令行功能,在命令行上可以用“<”表示输入重定向,在“<”后跟随输入文件名,则程序将从指定的输入文件中获取输入数据,而不再从键盘读入数据。也可以用“>”表示输出重定向。在“>”后跟输出文件名,则程序产生的标准输出将写入指定的输出文件中,而不是显示在屏幕上。

我们可以预先将输入数据存到文本文件中(如果有多组测试数据,可以存成多个文件),用重定向指定准备使用的输入数据。

例如,程序名为myprog,输入数据已经存到文件test.txt中,则在命令行下可以这样执行:

C:>myprog < test.txt

则程序会直接从test.txt中读取输入。如果想把输出结果也存到文件中(这在输出结果比较多的时候尤其有用,因为直接输出到屏幕上可能会来不及看到输出,或看不全所有的输出),例如,可以这样执行:

C:>myprog > test.out

这样我们就可以在执行后,用一个文本编辑器打开输出文件,慢慢阅读和分析输出结果。

如果把输入和输出的重定向结合起来,也可以这样执行:

C:>myprog < test.txt > test.out
ABCDE @ 2013-04-11 09:52:25
[ Quote ] [ Edit ] [ Delete ] 3#
终于 终于过了

#include"stdio.h"
int main()
{
char a[1000];
int n,i;
scanf("%d",&n);
gets(a);
while(gets(a)!=0)

{
n--;

if(n>=0)

{

for(i=0;a[i]!='\0';i++)

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

printf("\n");
printf("\n");

}

else

{
for(i=0;a[i]!='\0';i++)

if(a[i]==' ')
{
printf("\n");

printf("\n");
}


else printf("%c",a[i]);

printf("\n");
printf("\n");
}

}

return 0;
}
*13xl07 @ 2013-06-16 11:32:13
[ Quote ] [ Edit ] [ Delete ] 4#
题真难
*13xl02 @ 2013-06-16 11:33:09
[ Quote ] [ Edit ] [ Delete ] 5#
so easy
*13xl07 @ 2013-06-16 11:33:15
[ Quote ] [ Edit ] [ Delete ] 6#
终于做出来饿了
*13xl07 @ 2013-06-16 11:33:46
[ Quote ] [ Edit ] [ Delete ] 7#
你做了几个了@*13xl02

jf13831212 @ 2013-10-19 16:09:45
[ Quote ] [ Edit ] [ Delete ] 8#
#include <stdio.h>
int main()
{
unsigned long number,a;
scanf("%ld",&number);
if(number>=500)
a=800*number*0.8;
else
if(number>=300)
a=800*number*0.82+1;
else
if(number>=200)
a=800*number*0.85+1;
else
if(number>=100)
a=800*number*0.9;
else
a=800*number*1.0;
printf("%ld",a);
return 0;
}
为啥答案不对呢
jf13831240 @ 2013-11-11 17:05:14
[ Quote ] [ Edit ] [ Delete ] 9#
c程序怎么呢么不简单也(\-/.\-/)!!
sf14832124 @ 2014-10-09 10:30:45
[ Quote ] [ Edit ] [ Delete ] 10#
jk14171127 @ 2014-10-29 09:39:39
[ Quote ] [ Edit ] [ Delete ] 11#
0.0
xiao @ 2014-12-11 16:45:21
[ Quote ] [ Edit ] [ Delete ] 12#
http://developer.51cto.com/art/200707/51179.htm
PGJ135611 @ 2015-05-28 16:59:27
[ Quote ] [ Edit ] [ Delete ] 13#
so easy
txp7662600 @ 2015-05-28 17:07:54
[ Quote ] [ Edit ] [ Delete ] 14#
佩服
xf16113121 @ 2016-10-15 23:20:50
[ Quote ] [ Edit ] [ Delete ] 15#
#include<stdio.h>
int main()
{
char c1='C',c2='h',c3='i',c4='n',c5='a';
c1+=4;
c2+=4;
c3+=4;
c4+=4;
c5+=4;
printf("%c%c%c%c%c\n",c1,c2,c3,c4,c5);
return 0;
}
老显示格式错误,很服,到底哪里格式错误!!!!!
201658501234 @ 2017-05-02 12:34:28
[ Quote ] [ Edit ] [ Delete ] 16#
一群辣鸡
sdwujkwb160507180114 @ 2017-06-22 11:39:16
[ Quote ] [ Edit ] [ Delete ] 17#
Process exited after 7.95 seconds with return value 0
[Top]  [Previous]  [Next]

HOME Back

한국어 中文 English
All Copyright Reserved 2008-2010 SDIBT TEAM
GPL2.0 2003-2010 HUSTOJ Project TEAM
Anything about the Problems, Please Contact Admin:admin