![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言
BoBo兵
这个作者很懒,什么都没留下…
展开
-
C语言中gets()和scanf()的区别
scanf( )函数和gets( )函数都可用于输入字符串,但在功能上有区别。若想从键盘上输入字符串"hi hello",则应该使用__gets__函数。 gets可以接收空格;而scanf遇到空格、回车和Tab键都会认为输入结束,所有它不能接收空格。 char string[15]; gets(string); /*遇到回车认为输入结束*/ scanf("%s",string)转载 2017-11-29 19:38:25 · 430 阅读 · 0 评论 -
筛法求素数
Description 用筛法求之N内的素数。 Input N (0 < N <= 150) Output 0~N的素数 Sample Input 100 Sample Output 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 #include<...原创 2018-11-08 22:04:04 · 369 阅读 · 0 评论