// yasuo.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<stdio.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define LEN 40
int main(int argc, char* argv[])
{
FILE *in,*out;
int ch;
char name[LEN];
int count=0;
//检查命令行参数
if(argc<2)
{
fprintf(stderr,"Usage: %s filename\n",argv[0]);
exit(1);
}
//实现输入
if((in=fopen(argv[1],"r"))==NULL)
{
fprintf(stderr,"I couldn't open the file \"%s\"\n",argv[1]);
exit(2);
}
//实现输出
strcpy(name,argv[1]);
strcat(name,".red");
if((out=fopen(name,"w"))==NULL)
{
fprintf(stderr,"Can't create output file.\n");
exit(3);
}
//复制数据
while((ch=getc(in))!=EOF)
if(count++ %3==0)
putc(ch,out);
//收尾工作
if(fclose(in)!=0 || fclose(out)!=0)
fprintf(stderr,"Error in closing file\n");
return 0;
}
//我运行了以后提示我:Usage:E:\Program Files\Microsoft Visual Studio\MyProjects\reducto\Debug\reducto.exe filename
然后 我就去运行reducto.exe 屏幕闪一下就完了,我是真不明白
这程序改怎么运行?求大神帮助