鱼C论坛

 找回密码
 立即注册
查看: 3262|回复: 5

one problem.

[复制链接]
发表于 2012-4-6 07:29:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
#include <stdio.h>
void main ()
{
   int i=0;
   printf("Please inuput your grade:");
   scanf("&d",&i);
   if(i>=90&&i<=100)
               printf("Very Good! Your got A!\n",i);
   else if (i<90&&i>=80)
               printf("well, Still Good!It's a B.\n",i);
   else if (i<80&&i>=70)
               printf("good.C\n",i);
   else if (i<70&&i>=60)
               printf("Good LUck! U got a D.\n",i);
   else printf("Sorry, U lost again!\n",i);

}
not work out? :time:
小甲鱼最新课程 -> https://ilovefishc.com
发表于 2012-4-6 08:14:06 | 显示全部楼层
What's this?----------->scanf("&d",&i);
小甲鱼最新课程 -> https://ilovefishc.com
发表于 2012-4-6 08:37:46 | 显示全部楼层
本帖最后由 莫名其妙 于 2012-4-6 08:44 编辑

My English is not good with the Chinese answer

int i=0;
scanf("&d",&i);   数据要用%d   
   if(i>=90&&i<=100)
               printf("Very Good! Your got A!\n",i);   
else if (i<90&&i>=80)
               printf("well, Still Good!It's a B.\n",i);   
else if (i<80&&i>=70)
               printf("good.C\n",i);
  else if (i<70&&i>=60)
               printf("Good LUck! U got a D.\n",i);
  else printf("Sorry, U lost again!\n",i);
这些 i 是什么意思?    你如果只需要输出语句 不需要输出你上面输入的数据的话后面的i 不能写.
要不就写成printf("******%d***",i); 这种输出语句和i的值
而且你上面还给i 赋了初值 i=0 然后又 scanf() 输入i .

小甲鱼最新课程 -> https://ilovefishc.com
 楼主| 发表于 2012-4-6 09:08:57 | 显示全部楼层
Sorry, just install the Linux Ubuntu, not install the Chinese input yet. Only can type English now.
But thanks so much for reply.
要不就写成printf("******%d***",i)  This is the one I get wrong.  I change it "&" to "%" .
Then it is OK now.
Thanks for everyone here.
小甲鱼最新课程 -> https://ilovefishc.com
发表于 2012-4-6 10:20:56 | 显示全部楼层

还好看明白你说什么了,我记得ubuntu有中文输入法啊,默认就有的。难道你下载的是英文版的ubuntu?
小甲鱼最新课程 -> https://ilovefishc.com
 楼主| 发表于 2012-4-6 23:12:31 | 显示全部楼层
yep. I wanna learn English and the Linux system,
小甲鱼最新课程 -> https://ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-11-12 15:45

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表