问题 [英] problem

查看:72
本文介绍了问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

我想从键盘输入一个整数值并在屏幕上显示

WELL DONE很多次,我怎么能这样做。

Dear sir,
I want to input an integer value from keyboard and display on screen
"WELL DONE" that many times, how can i do this.

推荐答案

ka ************ @ yahoo.com 说:

亲爱的先生,

我想从键盘输入一个整数值并在屏幕上显示

WELL DONE很多次,我怎么能这样做。
Dear sir,
I want to input an integer value from keyboard and display on screen
"WELL DONE" that many times, how can i do this.



编写C程序,测试并执行它。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上述域名中, - www。

By writing a C program, testing it, and executing it.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


ka ************ @ yahoo.com 写道:

尊敬的先生,
Dear sir,



请不要在Usenet上多发帖子。


-

Ian Collins。

Please don''t multi-post on Usenet.

--
Ian Collins.


On 9 Maj,11:26,kapil_ghai2 ... @ yahoo.com写道:
On 9 Maj, 11:26, kapil_ghai2...@yahoo.com wrote:

尊敬的先生,

我想从键盘输入一个整数值并在屏幕上显示

WELL DONE很多次,我怎么能这样做。
Dear sir,
I want to input an integer value from keyboard and display on screen
"WELL DONE" that many times, how can i do this.



如果没有人回复。这是一个适合我的解决方案:


#include< stdio.h>


int main(int argc,char * argv [])

{

int number;

int counter;


printf(" ;输入数字>");


scanf("%d",& number);


/ *允许值1-99只* /

if(数字0&& number< 100)

for(counter = 0; counter< number; counter ++)

printf(WELL DONE \ n);

else

printf(坏号码。);


返回(0);

}


如何编译​​它

C:\ temp> gcc -ansi -pedantic well_done.c -o well_done.exe


Tw使用示例:

C:\ temp> well_done.exe

输入数字> foo

坏数字。


C:\ temp> well_done.exe

输入数字> 2

做得好

做得好


另见fx:
http:// en。 wikibooks.org/wiki/C_Progr...put_and_Output


另外:尝试使用自己喜欢的搜索引擎解决问题

- 你从中学到很多东西。


/每


-


每个Erik Strandberg

..NET架构师 - 优化

Tomlab Optimization Inc.
http://tomopt.com/tomnet/

In case no one replied. Here''s a solution that works for me:

#include <stdio.h>

int main(int argc, char * argv[])
{
int number;
int counter;

printf("Enter number >");

scanf("%d", &number);

/* allow values 1-99 only */
if (number 0 && number < 100)
for(counter = 0; counter < number; counter++)
printf("WELL DONE\n");
else
printf("bad number.");

return(0);
}

How I compiled it
C:\temp>gcc -ansi -pedantic well_done.c -o well_done.exe

Tw examples of usage:
C:\temp>well_done.exe
Enter number >foo
bad number.

C:\temp>well_done.exe
Enter number >2
WELL DONE
WELL DONE

Also see f.x:
http://en.wikibooks.org/wiki/C_Progr...put_and_Output

Also: try to solve your problems by using your favorite search engine
- you learn a lot from it.

/Per

--

Per Erik Strandberg
..NET Architect - Optimization
Tomlab Optimization Inc.
http://tomopt.com/tomnet/


这篇关于问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆