Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //217
- #include <cstdio>
- int main(void) {
- FILE* fin = fopen("input.txt", "r");
- FILE* fout = fopen("output.txt", "w");
- char n[11];
- fscanf(fin, "%s", n);
- fclose(fin);
- for (int i = 1; n[i] != 0; ++ i) {
- n[i] -= n[i - 1];
- if (n[i] < 0)
- n[i] = 10 + n[i];
- n[i] += 0x30;
- }
- fprintf(fout, "%s\n", n);
- fclose(fout);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement