c语言 每个糖果1元,三张糖果纸换一个糖果,问N元最多能买几个糖果#includeint mian(){\x05int T,i,N,n,count=0;\x05scanf("%d\n",&T);\x05for(i=0;ic:\users\milkliko\documents\visual studio 2010\projects\sdfa\sdfa\sdfsdf.c(5):warning
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 19:54:16
c语言 每个糖果1元,三张糖果纸换一个糖果,问N元最多能买几个糖果#includeint mian(){\x05int T,i,N,n,count=0;\x05scanf("%d\n",&T);\x05for(i=0;ic:\users\milkliko\documents\visual studio 2010\projects\sdfa\sdfa\sdfsdf.c(5):warning
c语言 每个糖果1元,三张糖果纸换一个糖果,问N元最多能买几个糖果
#include
int mian()
{
\x05int T,i,N,n,count=0;
\x05scanf("%d\n",&T);
\x05for(i=0;ic:\users\milkliko\documents\visual studio 2010\projects\sdfa\sdfa\sdfsdf.c(5):warning C4996:'scanf':This function or variable may be unsafe.Consider using scanf_s instead.To disable deprecation,use _CRT_SECURE_NO_WARNINGS.See online help for details.
1> e:\vs\vc\include\stdio.h(304) :参见“scanf”的声明
1>c:\users\milkliko\documents\visual studio 2010\projects\sdfa\sdfa\sdfsdf.c(8):warning C4996:'scanf':This function or variable may be unsafe.Consider using scanf_s instead.To disable deprecation,use _CRT_SECURE_NO_WARNINGS.See online help for details.
1> e:\vs\vc\include\stdio.h(304) :参见“scanf”的声明
c语言 每个糖果1元,三张糖果纸换一个糖果,问N元最多能买几个糖果#includeint mian(){\x05int T,i,N,n,count=0;\x05scanf("%d\n",&T);\x05for(i=0;ic:\users\milkliko\documents\visual studio 2010\projects\sdfa\sdfa\sdfsdf.c(5):warning
已改,看注释
#include
int main() //不是mian,是main
{
\x05int T,i,N,n,count=0;
\x05scanf("%d",&T); //去掉\n
\x05for(i=0;i0); //这里是>0
\x05\x05printf("%d\n",count+n);
\x05}
\x05return 0;
}