博客
关于我
codeforces 791A-C语言解题报告
阅读量:617 次
发布时间:2019-03-13

本文共 257 字,大约阅读时间需要 1 分钟。

题目解析

1.输入a,b,每一年a3;b2,问多少年a>b?

2.因为不知道需要循环多少次,使用while循环

代码

#include
#include
#include
int main(){ int a,b,i=0; scanf("%d %d",&a,&b); while(a<=b) { a*=3; b*=2; ++i; } printf("%d",i); system("pause"); getchar(); return 0;}

转载地址:http://pjkaz.baihongyu.com/

你可能感兴趣的文章
Nginx SSL私有证书自签,且反代80端口
查看>>
Nginx upstream性能优化
查看>>
Nginx 中解决跨域问题
查看>>
nginx 代理解决跨域
查看>>
Nginx 做负载均衡的几种轮询策略分析
查看>>
Nginx 入门,一篇搞定!
查看>>
Nginx 利用代理转发请求示例
查看>>