Created
December 17, 2014 04:20
-
-
Save Code-Hex/043bff03791b033bbf71 to your computer and use it in GitHub Desktop.
6-6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(){ | |
| int money = 1000; /* 時給がこれくらいあったらいいのに... */ | |
| int jikan; | |
| float give_you_money; | |
| printf("一週間に働いた時間を入力して\n"); | |
| scanf("%d", &jikan); | |
| jikan = jikan > 40 ? (jikan - 40) * 1.5 + 40 : jikan; | |
| give_you_money = money * jikan; | |
| printf("一週間分の君の給料: %d円\n", (int)give_you_money); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
時間給をKの願望じゃなくて任意の値にできたらいいかな(白い目)