[hackerrank]Manasa and Stones
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                [hackerrank]Manasa and Stones
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.                        
                                https://www.hackerrank.com/contests/w2/challenges/manasa-and-stones
簡單題。
#include<iostream> using namespace std;int main() {int T;cin >> T;while (T--) {int n, a, b;cin >> n >> a >> b;// a < bif ( a > b) {int tmp = a;a = b;b = tmp;}int last = 0;for (int i = 0; i < n; i++) {int x = i * b + (n - i - 1) * a;if (x != last) {last = x;cout << x << " ";}}cout << endl;}return 0; }
轉(zhuǎn)載于:https://www.cnblogs.com/lautsie/p/3915630.html
總結(jié)
以上是生活随笔為你收集整理的[hackerrank]Manasa and Stones的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 零.注意的细节
- 下一篇: 初见 IsolatedStorage
