![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
step
xiaohunuli
这个作者很懒,什么都没留下…
展开
-
hdu 2399 GPA
HDU 2399 GPA http://acm.hdu.edu.cn/showproblem.php?pid=2399 #include #include int main() { char s[1000]; while(gets(s)) { double j=0.00; int sum=0,tag=1; for(int i=0;i { if(s[i]==' ')原创 2013-02-02 10:45:47 · 180 阅读 · 0 评论 -
HDU 1197 Specialized Four-Digit Numbers
http://acm.hdu.edu.cn/showproblem.php?pid=1197 #include int change(int n,int base) { int a=0; while(n) { a+=n%base; n=n/base; } return a; } int main() { int sum10,sum12,sum16,i; for(i=2992原创 2013-02-05 11:34:06 · 209 阅读 · 0 评论 -
hdu 1219 AC Me
http://acm.hdu.edu.cn/showproblem.php?pid=1219 #include #include char s[100001]; int a[26]; int main() { int i; while(gets(s)) { memset(a,0,sizeof(a)); for(i=0;i { if(s[i]>='a'&&s[i] a原创 2013-02-04 15:20:02 · 170 阅读 · 0 评论 -
hdu 2138 How many prime numbers
http://acm.hdu.edu.cn/showproblem.php?pid=2138 #include #include int isprime(int m) { for(int i=2;i<=sqrt(m);i++) if(m%i==0) return 0; return 1; } int main() { int T,a; while(scanf原创 2013-07-14 19:50:24 · 345 阅读 · 0 评论 -
hdu 1722 Cake
点击打开链接 开始没什么思路,看了别人的博客才豁然开朗,有思路代码就很简单了,把蛋糕分成p块,再拼在一起分成q块,分成p块需切p刀,分成p块需切p刀,拼在一起则需减去公共部分,即需切p+q-gcd(p,q)刀 #include int gcd(int p,int q) { int r,t=0; if(p<q){ t=p; p=q; q=t; } r=p%原创 2013-07-14 21:00:02 · 324 阅读 · 0 评论 -
hdu 1215 七夕节
http://acm.hdu.edu.cn/showproblem.php?pid=1215 主要问题在于容易超时。。。 #include #include int main() { int T,m; while(scanf("%d",&T)!=EOF){ while(T--){ scanf("%d",&m); int t,sum=1;原创 2013-07-14 22:59:49 · 346 阅读 · 0 评论 -
hdu 1060 Leftmost Digit
http://acm.hdu.edu.cn/showproblem.php?pid=1060 m=n^n;两边同取对数,得到,log10(m)=n*log10(n);再得到,m=10^(n*log10(n)); 然后,对于10的整数次幂,第一位是1,所以,第一位数取决于n*log10(n)的小数部分 #include #include int main() {原创 2013-07-26 19:44:40 · 295 阅读 · 0 评论 -
hdu 1286 找新朋友
http://acm.hdu.edu.cn/showproblem.php?pid=1286 #include #include int main() { int a[40000],T,i; while(scanf("%d",&T)!=EOF){ while(T--){ memset(a,0,sizeof(a)); int n,count=0;原创 2013-07-26 15:46:21 · 278 阅读 · 0 评论