题解 | 藻类植物

藻类植物

https://www.nowcoder.com/practice/624cee6440a644398df5bade13297f49

//  #牛客春招刷题训练营# https://www.nowcoder.com/discuss/726480854079250432
//  模拟题
#include <iostream>
using namespace std;

int main() {
  int last, x, r, d;
  cin >> r >> d >> last;
  int i = 0;
  while(i < 10){
    x = last * r -d;
    last = x;
    i++;
    cout << (last < 0 ? 0 : last) << endl;//--------我不知道样例里面有没有但是建议加一个last<0的判断
  }
  return 0;
}
// 64 位输出请用 printf("%lld")

#写题解领奖励##牛客春招刷题训练营#
全部评论

相关推荐

07-16 14:10
门头沟学院 Java
点赞 评论 收藏
分享
06-01 21:50
已编辑
天津理工大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务