基础练习 字母图形

2019-03-16  本文已影响0人  HeoLis

http://lx.lanqiao.cn/problem.page?gpid=T7

#include <iostream>
using namespace std;
#define abs(x) ((x) > 0 ? (x) : (-x))
int main(){
    unsigned N(0), M(0);
    cin >> N >> M;
    for (unsigned i(0); i != N; ++i){
        for (unsigned j(0); j != M; ++j){
            int sub = i % 26 - j;
            cout << (char)(abs(sub) % 26 + 65);
        }
        cout << endl;
    }
    return 0;
}
上一篇 下一篇

猜你喜欢

热点阅读