谁能帮我看下这段C语言哪里出错了?
#include"stdio.h"#include"stdlib.h"voidmain(intargc,char*argv[]){inti; charch;&n...
#include "stdio.h"#include "stdlib.h"void main(int argc,char*argv[]){ int i; char ch; printf ("真的要删除吗?%s(Y\N)?",argv[i]); scanf ("%c",&ch); if (ch == "Y" ||ch == "y") printf ("成功");else printf ("失败"); }'该段代码写自C与C++程序设计学习与实验系统 2011.2'最好帮我改写,找师傅中...
展开
2个回答
2011-10-24
展开全部
#include "stdio.h"
#include "stdlib.h"
void main(int argc,char*argv[])
{
int i=0;
char ch;
printf ("真的要删除吗?%s(Y\\N)?",argv[i]);
scanf ("%c",&ch);
if (ch == 'Y' ||ch == 'y')
printf ("成功");
else printf ("失败");
}
#include "stdlib.h"
void main(int argc,char*argv[])
{
int i=0;
char ch;
printf ("真的要删除吗?%s(Y\\N)?",argv[i]);
scanf ("%c",&ch);
if (ch == 'Y' ||ch == 'y')
printf ("成功");
else printf ("失败");
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询