码迷,mamicode.com
首页 >  
搜索关键字:printf bc    ( 16964个结果
c编程实例:809*??=800*??+9*???+1
程序代码:#include#includevoid main(){ int c; int i,j,k; printf("start computing!!!"); for(i=10;i10&&k<100) printf("809*%d=800*%d+9*%d+1\n",i,k,j); } } ...
分类:其他好文   时间:2014-07-22 23:38:07    阅读次数:242
2_3 回文判断
#include #include void main(){ int x,i; char str[100]; //gets(st1); printf("Please input a string to find out whether the string is palind...
分类:其他好文   时间:2014-07-22 23:04:32    阅读次数:240
sprintf,你知道多少?
选自《CSDN 社区电子杂志——C/C++杂志》http://emag.csdn.net 2005 年1 月 总第1 期 - 93 -本文作者:steedhorse(晨星)printf 可能是很多程序猿在開始学习C 语言时接触到的第二个函数(我猜第一个是main),说起来,自然是老朋友了,但是,你对...
分类:其他好文   时间:2014-07-22 22:58:12    阅读次数:282
奋战4小时的家庭作业
#includeint main(viod) { int a,b,c,max,min,mid,stemp1,stemp2,stemp3; printf("请输入三个数,用逗号分隔"); scanf("%d,%d,%d",&a,&b,&c); max=a; max=max>b?max:b; ...
分类:其他好文   时间:2014-07-22 22:41:12    阅读次数:223
449A - Jzzhu and Chocolate 贪心
一道贪心题,尽量横着切或竖着切,实在不行在交叉切 #include #include using namespace std; int main(){ // freopen("in.txt","r",stdin); long long n,m,k; while(cin>>n>>m>>k){ if((n+m-2)<k){ printf...
分类:其他好文   时间:2014-07-22 22:38:53    阅读次数:160
P53
#include double fun(double q) { int n=2; double s=2.0; while(s<=q) { s=s+(double)(n+1)/n; n++; } return s; } main() { printf("%f\n",fun(50)); }...
分类:其他好文   时间:2014-07-22 22:38:36    阅读次数:136
map的Key参数可以是类吗?
如:class cls{ public: void print(int i){printf(i);};}int main(){ std::map mymap; return 0;}这段程序是否有问题?上面的cls作为Key来说需要满足1. 支持 < 运算符,或者给定了<判断式,map内部是红...
分类:其他好文   时间:2014-07-22 22:35:54    阅读次数:203
P65
#include #define N 6 main() { char c[N]; int i=0; for(;i<N;c[i]=getchar(),i++); printf("\n%d\n",i); for(i=0;i<N;i++) putchar(c[i]); printf("\n"); } 有点不一样...
分类:其他好文   时间:2014-07-22 22:34:14    阅读次数:267
c和c++的输入输出
格式输出:  printf(格式控制, 输出表列); %d 十进制数  %md m为指定的宽度 若数据位数小于m,则左端补以空格;若大于m,则按实际位数输出 %ld 长整型数据  %mld 指定字段宽度 %o 八进制整数形式  %mo %x 十六进制整数形式  %mx %u unsigned型数据,它也可用%o或%x格式输出 %c 一个字符   %mc %s 字符串 有几种用法 ...
分类:编程语言   时间:2014-07-22 22:34:12    阅读次数:573
P64
#include void fun(long s,long *t) { int d; long s1=1; *t=0; while(s>0) { d=s%10; if(d%2!=0) {*t=d*s1+*t; s1*=10; } s/=10; } } void main() { long s,t; printf("\nPlease enter:"); sc...
分类:其他好文   时间:2014-07-22 22:34:12    阅读次数:201
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!