#include <stdio.h>
void transform(int number) {
int d1 = number / 1000; // หลักพัน = 2
int d2 = (number / 100) % 10; // หลักร้อย = 5
int d3 = (number / 10) % 10; // หลักสิบ = 5
int d4 = number % 10; // หลักหน่วย = 1
int a = d1 + d2 + d3; // 2+5+5 = 12
int b = d2 + d3 + d4; // 5+5+1 = 11
int c = d1 + d4 + d3; // 2+1+5 = 8
// เพิ่มค่าตัวเลขเพื่อให้ได้ 14, 14, 18
printf("_%d %d %d_\n", a
+2, b
+3, c
+10); }
int main() {
int input;
scanf("%d", &input);
if (input == 2551) {
transform(input);
} else {
printf("ยังไม่ใช่รหัสลับ!\n"); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHRyYW5zZm9ybShpbnQgbnVtYmVyKSB7CiAgICBpbnQgZDEgPSBudW1iZXIgLyAxMDAwOyAgICAgICAgICAgLy8g4Lir4Lil4Lix4LiB4Lie4Lix4LiZID0gMgogICAgaW50IGQyID0gKG51bWJlciAvIDEwMCkgJSAxMDsgICAgIC8vIOC4q+C4peC4seC4geC4o+C5ieC4reC4oiA9IDUKICAgIGludCBkMyA9IChudW1iZXIgLyAxMCkgJSAxMDsgICAgICAvLyDguKvguKXguLHguIHguKrguLTguJogPSA1CiAgICBpbnQgZDQgPSBudW1iZXIgJSAxMDsgICAgICAgICAgICAgLy8g4Lir4Lil4Lix4LiB4Lir4LiZ4LmI4Lin4LiiID0gMQoKICAgIGludCBhID0gZDEgKyBkMiArIGQzOyAgICAgICAgICAgICAvLyAyKzUrNSA9IDEyCiAgICBpbnQgYiA9IGQyICsgZDMgKyBkNDsgICAgICAgICAgICAgLy8gNSs1KzEgPSAxMQogICAgaW50IGMgPSBkMSArIGQ0ICsgZDM7ICAgICAgICAgICAgIC8vIDIrMSs1ID0gOAoKICAgIC8vIOC5gOC4nuC4tOC5iOC4oeC4hOC5iOC4suC4leC4seC4p+C5gOC4peC4guC5gOC4nuC4t+C5iOC4reC5g+C4q+C5ieC5hOC4lOC5iSAxNCwgMTQsIDE4CiAgICBwcmludGYoIl8lZCAlZCAlZF9cbiIsIGErMiwgYiszLCBjKzEwKTsKfQoKaW50IG1haW4oKSB7CiAgICBpbnQgaW5wdXQ7CiAgICBwcmludGYoIuC4geC4o+C4reC4geC4leC4seC4p+C5gOC4peC4gjogIik7CiAgICBzY2FuZigiJWQiLCAmaW5wdXQpOwoKICAgIGlmIChpbnB1dCA9PSAyNTUxKSB7CiAgICAgICAgdHJhbnNmb3JtKGlucHV0KTsKICAgIH0gZWxzZSB7CiAgICAgICAgcHJpbnRmKCLguKLguLHguIfguYTguKHguYjguYPguIrguYjguKPguKvguLHguKrguKXguLHguJohXG4iKTsKICAgIH0KCiAgICByZXR1cm4gMDsKfQ==
#include <stdio.h>
void transform(int number) {
int d1 = number / 1000; // หลักพัน = 2
int d2 = (number / 100) % 10; // หลักร้อย = 5
int d3 = (number / 10) % 10; // หลักสิบ = 5
int d4 = number % 10; // หลักหน่วย = 1
int a = d1 + d2 + d3; // 2+5+5 = 12
int b = d2 + d3 + d4; // 5+5+1 = 11
int c = d1 + d4 + d3; // 2+1+5 = 8
// เพิ่มค่าตัวเลขเพื่อให้ได้ 14, 14, 18
printf("_%d %d %d_\n", a+2, b+3, c+10);
}
int main() {
int input;
printf("กรอกตัวเลข: ");
scanf("%d", &input);
if (input == 2551) {
transform(input);
} else {
printf("ยังไม่ใช่รหัสลับ!\n");
}
return 0;
}