标签:scan names scanf log clu cst bsp target ++
https://vjudge.net/problem/UVA-11040
找规律
#include<cstdio> using namespace std; int a[10][10]; int main() { int T,d; scanf("%d",&T); while(T--) { for(int i=1;i<=5;i++) for(int j=1;j<=i;j++) scanf("%d",&a[i*2-1][j*2-1]); for(int i=3;i<=9;i+=2) { for(int j=2;j<=9;j+=2) { a[i][j]=a[i-2][j-1]-a[i][j-1]-a[i][j+1]>>1; a[i-1][j-1]=a[i][j]+a[i][j-1]; a[i-1][j]=a[i][j]+a[i][j+1]; } } for(int i=1;i<=9;i++) { printf("%d",a[i][1]); for(int j=2;j<=i;j++) printf(" %d",a[i][j]); printf("\n"); } } }
UVA 11040 Add bricks in the wall
标签:scan names scanf log clu cst bsp target ++
原文地址:http://www.cnblogs.com/TheRoadToTheGold/p/7401464.html