博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
codeforces 791A-C语言解题报告
阅读量:614 次
发布时间:2019-03-13

本文共 259 字,大约阅读时间需要 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/

你可能感兴趣的文章