测试点AC但RE

CF791A Bear and Big Brother

@[林肯公园](/space/show?uid=95569) 照你这样肯定RE ```cpp for(i=1;;i++){ a*=3,b*=2; if(a>b) return printf("%d\n",i);0; } ``` 这样return了是不能退出的,还是老老实实break吧
by ComeOver· @ 2018-08-02 21:02:17


```cpp 蜜汁原因,应该是你的return printf有点问题 #include<bits/stdc++.h> using namespace std; int a,b; int main() { int i; scanf("%d%d",&a,&b); for(i=1;;i++) { a*=3,b*=2; if(a>b) {printf("%d\n",i);return 0;} } return 0; } ```
by goodlearndaydayup @ 2018-08-02 21:03:04


```cpp #include<bits/stdc++.h> using namespace std; int a,b; int main() { int i; scanf("%d%d",&a,&b); for(i=1;;i++){ a*=3,b*=2; if(a>b) return printf("%d\n",i)&0; } return 0; } ``` 原谅我蜜汁原因加了个&就AC
by goodlearndaydayup @ 2018-08-02 21:04:54


其实可以这样。。。 ```cpp return !printf("%d\n",i); ```
by 1124828077ccj @ 2018-08-02 21:05:25


应该还可以这样... ``` return printf("%d\n",i),0; ```
by Ezios @ 2018-08-02 21:17:48


谢谢
by Teddy·Bear @ 2018-08-03 07:44:09


大佬万岁
by Teddy·Bear @ 2018-08-03 07:44:24


|