摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1408这题直接模拟,直到盐水滴完,有地方需要注意 就是要用double,否则会出错#include<stdio.h>int main(){ int time,i,j,e; double vul,d; while(scanf("%lf%lf",&vul,&d)!=EOF) { time=0; e=1; while(vul) { for(i=1;i<=e;i++) { time++; ... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1256按题目要求用所给的字母画出一个“8”,先求上宽,再求下宽,再求横宽,分为5部分来输出#include<stdio.h>int main(){ int t,n,i,h1,w,h2,j; char s,a[10]; scanf("%d",&t); gets(a); while(t--) { scanf("%c%d",&s,&n); gets(a); h1=(n-3)/2; h2=n-3-h1; w=1+n/6; ... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1228题目很简单,不过自己写的代码很繁,先判断加号前面的,判断时可以通过空格的数量来计算数字的多少,然后判断加号后面,等号前面的#include<stdio.h>#include<string.h>int main(){ int n,a,b,i,j,sum; char str[11][10]={"zero","one","two","three","four","five&qu 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1229这题,是我想多了ac代码#include<stdio.h>int main() // 代码一AC{ const int right[8] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000}; int a, b, k; while (scanf("%d%d%d", &a, &b, &k) != EOF && (a != 0 || b != 0)) { if (a % right 阅读全文