Advertisement
AndreyKlipikov

D. Домино

Sep 29th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6.   int x, res = 0;
  7.   scanf("%d", &x);
  8.   for(int i = 0; i <= x; i++) {
  9.     for(int j = i; j <= x; j++) {
  10.       printf("%d-%d\n", i, j);
  11.       res += i + j;
  12.     }
  13.   }
  14.   printf("%d", res);
  15.   return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement