// Online C compiler to run C program online
#include <stdio.h>
/* 2016/09/22 */
int first4(int x){
return x/10000;
}
int last4(int x){
/* The operator % in C computes the remainder after division.
For example, the answer of 23%7 will be 2.*/
return x%10000;
}
int first8(int x){
return x/100000000;
}
int last8(int x){
return x%100000000;
}
int shift4(int x){
return x*10000;
}
int main(void){
int x;
int a, b;
int c1, c2, c3;
/* Assume that the input is always an 8-digit positive integer. */
a = first4(x);
b = last4(x);
c3 = first8(x);
c2 = last8(x);
c1 = shift4(x);
//printf("%4d%08d%04d", ???, ???, ???);
/* %04d will display a 4-digit number and add 0 as padding before the number if necessary */
return 0;
}
Ly8gT25saW5lIEMgY29tcGlsZXIgdG8gcnVuIEMgcHJvZ3JhbSBvbmxpbmUKI2luY2x1ZGUgPHN0ZGlvLmg+Ci8qIDIwMTYvMDkvMjIgKi8KaW50IGZpcnN0NChpbnQgeCl7CiAgIHJldHVybiB4LzEwMDAwOwp9CmludCBsYXN0NChpbnQgeCl7CiAgIC8qIFRoZSBvcGVyYXRvciAlIGluIEMgY29tcHV0ZXMgdGhlIHJlbWFpbmRlciBhZnRlciBkaXZpc2lvbi4KICAgICAgRm9yIGV4YW1wbGUsIHRoZSBhbnN3ZXIgb2YgMjMlNyB3aWxsIGJlIDIuKi8KICAgcmV0dXJuIHglMTAwMDA7Cn0KaW50IGZpcnN0OChpbnQgeCl7CiAgIHJldHVybiB4LzEwMDAwMDAwMDsKfQppbnQgbGFzdDgoaW50IHgpewogICByZXR1cm4geCUxMDAwMDAwMDA7Cn0KaW50IHNoaWZ0NChpbnQgeCl7CiAgIHJldHVybiB4KjEwMDAwOwp9CmludCBtYWluKHZvaWQpewogICBpbnQgeDsKICBpbnQgYSwgYjsKICBpbnQgYzEsIGMyLCBjMzsKICAvKiBBc3N1bWUgdGhhdCB0aGUgaW5wdXQgaXMgYWx3YXlzIGFuIDgtZGlnaXQgcG9zaXRpdmUgaW50ZWdlci4gKi8KICBzY2FuZigiJWQiLCB4KTsgCiAgYSA9IGZpc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