码迷,mamicode.com
首页 >  
搜索关键字:scanf    ( 10388个结果
c语言学习之结构篇代码示例-输入n个同学的姓名,数学英语成绩,按照平均分从低到高排序并输出
#include void main(){ const int count = 5;//定义数量 struct student{ char name[80]; float math,eng; float aver; }stu[count],temp; //输入 for (int i = 0; i scanf("%s%f%f", stu[i].name, &stu[i].m...
分类:编程语言   时间:2014-05-22 11:21:15    阅读次数:312
黑马程序员-C学习笔记之scanf
---------------------- IOS开发、Android培训、期待与您交流! ----------------------  一、scanf函数介绍             这也是在stdio.h中声明的一个函数,因此使用前必须加入#include。调用scanf函数时,需要传入变量的地址作为参数,scanf函数会等待标准输入设备(比如键盘)输入数据,并且将输入的数据赋值给...
分类:其他好文   时间:2014-05-22 11:06:15    阅读次数:252
最长上升子序列之基础
代码a #include #define maxn 1005 int a[maxn]; int dp[maxn]; int max(int x,int y) {     return x>y?x:y; } int main() {     int t,n;            scanf("%d",&t);...
分类:其他好文   时间:2014-05-22 09:16:47    阅读次数:192
编程题:输入a、b两个数,输出其中最大值。
编程题:输入a、b两个数,输出其中最大值。#include<stdio.h>floatmax(floatx,floaty){floatz;if(x>y)z=x;elsez=y;returnz;}main(){floata,b,c;scanf("%f,%f",&a,&b);c=max(a,b);printf("%f,%f,themaxis%f\n",a,b,c);}输入:23,56输出:23.000000,56.000000..
分类:其他好文   时间:2014-05-21 02:50:36    阅读次数:324
编程题:学生成绩评分
编程题:学生成绩评分#include<stdio.h>voidmain(){intscore;printf("请输入学生分数:"); scanf("%d",&score); switch(score/10) {case10: case9:printf("成绩优秀\n");break;/*成绩在90~100分*/ case8:printf("成绩良好\n");break;/*成绩在80~89分*/ case7:print..
分类:其他好文   时间:2014-05-21 00:38:21    阅读次数:356
c库函数:scanf()函数的使用
编程题:scanf()函数的使用#include<stdio.h>main(){intx,y,a1,b1,a2,b2,c2;scanf("x=%d,y=%d",&x,&y);scanf("%d,%d,%d",&a1,&b1,&c1);scanf("%d,%d,%d",&a2,&b2,&c2);printf("x=%d,y=%d\n",x,y);printf("a1=%d,b1=%d,c1=%d\n",a1,b1,c1..
分类:其他好文   时间:2014-05-20 21:06:38    阅读次数:352
模和除
模和除题目描述两个整数x和y,满足1#includeint main(){ __int64 a,b,sum,c; __int64 i,j,temp; while(scanf("%I64d%I64d",&a,&b)!=EOF) { sum=0; if...
分类:其他好文   时间:2014-05-20 10:17:49    阅读次数:313
UVA 11270 Tiling Dominoes(插头DP)
题目链接:11270 - Tiling Dominoes 和POJ 2411一样的题目,试着用插头DP写了下 代码: #include #include #include using namespace std; int n, m, pre = 0, now = 1; long long dp[2][2222]; int main() { while (~scanf("%d%d",...
分类:其他好文   时间:2014-05-18 14:44:37    阅读次数:264
Codeforces Round #246 (Div. 2)
A、Choosing Teams 水题 #include #include using namespace std; int main() { int n, k, ans, i, x; scanf("%d%d",&n,&k); ans = 0; for(i=0; i<n; ++i) { scanf("%d",&x);...
分类:其他好文   时间:2014-05-18 10:53:23    阅读次数:262
poj1655 Balancing Act 【树形DP(很弱)】
都不知道怎么分类了。 大概要求一个树中以某个结点为根的子树结点个数,还有儿子结点中以儿子结点为根的子树结点个数的最大值,用递归得到n[i],以i为根节点的子树结点个数 #include #include #include #include #include #include #include using namespace std; #define scan(a) scanf("...
分类:其他好文   时间:2014-05-18 07:26:01    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!