---
# System prepended metadata

title: '*2022/03/22 CPE_01*'
tags: [CPE]

---

###### tags: `CPE`
# *2022/03/22 CPE_01*
## 題目：
![](https://i.imgur.com/dlMzIHH.png)
![](https://i.imgur.com/aSeVkPD.png)
```
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int result = 0;
    int input;
    int index_value;
    
    while (true) {
        scanf("%d", &input);
        if (input != 0) {
            for (int i = 1; result <= input; i++) {
                result = result + i;
                index_value = i;
            }
            result = result - index_value;

            //Lose the last one
            if (result == input) {
                printf("%d\t%d\n", index_value, index_value);
            }
            //Not lose the last one
            else
            {
                result += index_value;
                printf("%d\t%d\n", (result - input), index_value);
            }
            input = 0;
            index_value = 0;
            result = 0;
        }
        else {
            break;
        }
    }
    return 0;
}
```