0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ABC127

Last updated at Posted at 2019-09-06

A - Ferris Wheel

# include<bits/stdc++.h>
using namespace std;

int main(){
    int A,B; cin >> A >> B;
    if (A>=13) cout << B;
    else if (6<=A && A<=12) cout << B/2;
    else cout << 0;
}

改善点(&&)

else if (6<=A && A<=12)の黒字の部分を6<=A<=12としないように気を付ける!

B - Algae

# include<bits/stdc++.h>
using namespace std;

int main(){
    int r,D,X; cin >> r >> D >> X;
    for (int i=0; i<10; i++){
        X=r*X-D;
        cout << X << endl;
    }
}

改善点

X=r*X-D;の計算は右辺から始まり、最後に左辺に代入するという順番であることを忘れるな!

C - Prison

よくわからん


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?