码迷,mamicode.com
首页 >  
搜索关键字:scanf    ( 10388个结果
C primer plus 练习题 第三章
5. 1 #include 2 3 int main() 4 { 5 float you_sec; 6 printf("请输入你的年龄:"); 7 scanf("%f", &you_sec); 8 printf("年龄合计:%e 秒!\n", you_sec * ...
分类:其他好文   时间:2014-07-06 16:24:54    阅读次数:162
一个正整数N,不用sqrt求开方数
#include int main() { int n; // 正整数n int i; // for循环 int myR = 1; // 保证myR^2 <= n < (myR+1)^2 double temp; // 临时变量 while(scanf("%d", &n) != EOF) { if (n <= 0) continue; // 寻找myR for (i=1;...
分类:其他好文   时间:2014-07-03 18:29:48    阅读次数:158
06-scanf函数
一、变量的内存分析1.字节和地址为了更好地理解变量在内存中的存储细节,先来认识一下内存中的“字节”和“地址”。1>内存以“字节为单位”0x表示的是十六进制,不用过于纠结,能看懂这些数字之间谁大谁小就行了2>不同类型占用的字节是不一样的,数据越大,所需的字节数就越多2.变量的存储1>所占用字节数跟类型...
分类:其他好文   时间:2014-07-02 21:10:35    阅读次数:207
Linux 文件操作总结
文件是linux中的一个重要概念。在Linux中,一切(几乎一切)都是文件。简单的说,C中基本的的printf()函数,scanf()函数,其实都属于文件操作。对于文件操作,虽然都是通过函数调用的方式实现,却还是能分为两类:系统调用和库函数。这篇文章将先介绍linux中文件的概念,系统调用和库函数的...
分类:系统相关   时间:2014-07-02 18:47:29    阅读次数:207
uva 10127 - Ones(数论)
题目链接:uva 10127 - Ones 题目大意:给出n,问说者少要多少为1才可以整除n。 解题思路:等于是高精度取模,直到余数为0为止。 #include #include int main () { int n; while (scanf("%d", &n) == 1) { int ans = 1, c = 1; whil...
分类:其他好文   时间:2014-07-02 15:16:16    阅读次数:210
【C语言天天练(二十)】scanf函数详解
引言:scanf函数虽然是学习C语言时比较早就接触的一个函数,但在使用过程中,发现真正掌握它却并不容易。本文就通过各种例子来详细的总结一下该函数的各种用法,假设它的调用格式为 scanf("",)。 1、一般使用scanf函数时都是为某个变量赋值,不考虑它的返回值。但是任何函数都是需要返回的(即使返回类型用void,也可以认为只是调用了return语句,只是并没有返回什么东西而已),同样...
分类:编程语言   时间:2014-07-02 09:40:33    阅读次数:210
统计元音
http://acm.hdu.edu.cn/showproblem.php?pid=2027 1 #include 2 #include 3 #include 4 int main() 5 { 6 int n; 7 char a[102]; 8 scanf("%d",&...
分类:其他好文   时间:2014-07-01 21:30:47    阅读次数:199
POJ - 1731 Orders
题意:排序后字符串全排列 思路:好久没水一题了 #include #include #include #include using namespace std; const int MAXN = 220; char str[MAXN]; int main() { while (scanf("%s", str) != EOF) { int n = strlen(str); ...
分类:其他好文   时间:2014-07-01 15:09:17    阅读次数:182
A + B Problem II(大数加法)
一直格式错误,不想改了,没A 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int main() 8 { 9 int T,K=0;10 scanf("%d",&T);11 ...
分类:其他好文   时间:2014-06-30 14:01:05    阅读次数:188
总结文件操作函数(二)-C语言
格式化读写: #include  int printf(const char *format, ...);                   //相当于fprintf(stdout,format,…); int scanf(const char *format, …); int fprintf(FILE *stream, const char *format, ...);      //...
分类:编程语言   时间:2014-06-29 23:20:21    阅读次数:328
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!