码迷,mamicode.com
首页 >  
搜索关键字:scanf    ( 10388个结果
PAT----1001. A+B Format (20)
#includeint main(){ //定义要读入的两个整数 int a,b; //定义好放拆项用的数组 int D[9]; //读入两个整数 scanf("%d%d",&a,&b); //求和 int ans=a+b; //如果和是一个负数 ,输出负...
分类:其他好文   时间:2014-08-01 04:44:01    阅读次数:226
zju 2947 试探
#include using namespace std;int main(int argc, char *argv[]){ int i,n,m; char data1[10][20],data2[10][20]; scanf("%d",&n); for (i=0;i...
分类:其他好文   时间:2014-08-01 04:42:41    阅读次数:239
C的printf与scanf的用法
之前没学过C语言,只学过C++,所以就来自学下C语言了,其实个人认为C与C++的区别很小,基本上就是printf与scanf这点输出和输入的区别了,如果还有什么区别的话那就是要包含的头文件是不同的。比如在C++中,是#include.而在C中是#include在调用printf与scanf的时候一定...
分类:其他好文   时间:2014-07-31 23:50:00    阅读次数:278
偶数求和
Problem Description有一个长度为n(nint main(){ int m,n,i; while(scanf("%d%d",&n,&m)!=EOF) { int sum=0,k=0,j=0; for(i=1;i<=n;i++)//不能是for(i=...
分类:其他好文   时间:2014-07-31 23:31:00    阅读次数:163
P144
#include #include main() { char *p,*q; p=(char*)malloc(sizeof(char)*20); q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); }...
分类:其他好文   时间:2014-07-31 20:55:37    阅读次数:167
hdu 1052 田忌赛马
贪心,排序从大到小。。 先比大的,跑不过就拿最小的来送死。。, 如果是平局就比后面的。。。 若后面也是平局就拿去跟前面的去跑。。。 #include #include #include #include using namespace std; int s[1005],w[1005]; int main() {     int n,i;     while(scanf("...
分类:其他好文   时间:2014-07-31 20:50:47    阅读次数:153
素数判定
Problem Description对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39int main(){ int x,y,i,n,t,flag; while(scanf("%d%d",&x,&y)!=EOF&&(x!=0||y!=0))//又学会了一招·...
分类:其他好文   时间:2014-07-31 19:52:57    阅读次数:252
hdoj 1087 (DP)
代码:#include #include using namespace std; int a[1005], dp[1005]; int main() { int n,sum,i,j; while( scanf("%d",&n)&&n){ for( i=0; ia[j]) dp[i]=max...
分类:其他好文   时间:2014-07-31 16:42:26    阅读次数:151
HDU 1166
线段树 1 #include 2 #include 3 using namespace std; 4 #define N 200010 5 int sum[N]; 6 void build(int l,int r,int root){ 7 if(l==r)scanf("%d",&sum...
分类:其他好文   时间:2014-07-31 16:21:47    阅读次数:200
HDU 1754
第一题线段树,纪念一下 1 #include 2 #include 3 using namespace std; 4 int tree[800005]; 5 void build(int l,int r,int root){ 6 if(l==r){ 7 scanf("%...
分类:其他好文   时间:2014-07-31 12:23:06    阅读次数:208
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!