09 2011 档案
摘要:#include <stdio.h>#include <stdlib.h>#include <memory.h>char srcR[7], srcn[3];//string length, +1int dstR[5], dstn[2], point, n;//point记录小数点位置,n记录dstn的int形式;int ans[200], result[200];int main(){ while (1) { if (scanf("%s", srcR) == EOF) break; getchar(); scanf...
阅读全文
摘要:/*总结:1.float的精度是6位有效数字,取值范围是10的-38次方到10的38次方,float占用4字节空间 double的精度是15位有效数字,取值范围是10的-308次方到10的308次方,double占用8字节空间。 浮点数相等判断; const float EPSINON = 0.00001; if ((x >= - EPSINON) && (x <= EPSINON) 大于小于直接比较 2.不要将数量级相差较大的两个浮点数相加,也不可将两个相近的浮点数相减*/#include <stdio.h>#include <ma...
阅读全文
摘要:/*总结: 1.不要忘了溢出 2.单独处理最高位的加法更容易些。summary: 1.The overflow of addition of large numbers should be noticed. 2.It's easier to deal with the highest bit when adding,I think.*/#include <stdio.h>#include <string.h>#include <memory.h>int main(){ char srca[1000], srcb[1000]; int dsta[...
阅读全文
摘要:#include<iostream>using namespace std;int main(){ int array[21][21][21]; for (int i=0; i<=20; i++) { for (int j=0; j<=20; j++) { for (int k=0; k<=20; k++) { if (i == 0 || j == 0 || k == 0) { array[i][j][k] ...
阅读全文
摘要:#include <iostream>#include <memory.h>using namespace std;int weight[101][101], dis[101], pi[101];int visit[101] = {0};int minTime = 10000, vertexNum = 0;void input(){ int p = 0, cost = 0; for (int j=1; j<=vertexNum; j++) { cin >> weight[j][0]; for (int i=1; i<=weight[j][0];
阅读全文
摘要:#include<cstdio>#include<cstring>char c[50];int i,l;double x,y;int main(){ while(scanf("%s",c)!=EOF) { printf("%s [8] = ",c); l=strlen(c)-1; x=0; y=1; for(i=l;i>1;i--) { x=((c[i]-'0')*y+x)*125; y*=1000; } x/=y; i=0; while(x) { c[i]=int(x*=10)%10+'0'
阅读全文