Created
April 7, 2016 07:43
-
-
Save redgosho/35602577428338f78c1090647f90e8f8 to your computer and use it in GitHub Desktop.
やすのんに言われたので書いてみましたんこぶ。
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> | |
#include <stdlib.h> | |
int main() | |
{ | |
int a; | |
int b; | |
int ans; | |
a = 15; | |
b = 37; | |
ans = a + b; | |
printf("%d\n",ans); | |
int a2; | |
int b2; | |
int ans2; | |
a2 = 15; | |
b2 = 37; | |
ans2 = a2 - b2; | |
printf("%dから%dを引いた値は%dです。\n",a2,b2,ans2); | |
int i; | |
int ans3; | |
char num[9999]; | |
char c; | |
i = 0; | |
while(1) | |
{ | |
c = getchar(); | |
num[i] = c; | |
i++; | |
if (c == '\n'){ | |
break; | |
} | |
else{} | |
} | |
ans3 = atoi(num); | |
printf("%dを-100以下になるまで-10していきます。\n",ans3); | |
while(ans3 > -100){ | |
ans3 = ans3 - 10; | |
printf("%d\n",ans3); | |
} | |
printf("完了"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment