Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string>
- using namespace std;
- int main() {
- int x, res = 0;
- scanf("%d", &x);
- for(int i = 0; i <= x; i++) {
- for(int j = i; j <= x; j++) {
- printf("%d-%d\n", i, j);
- res += i + j;
- }
- }
- printf("%d", res);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement