Last active
November 5, 2019 08:48
-
-
Save pinglunliao/4b88a358c6b749991be6 to your computer and use it in GitHub Desktop.
a248: 新手訓練 ~ 陣列應用 FYI: https://yunlinsong.blogspot.com/2015/11/blog-post_7.html
This file contains 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 <cstdio> | |
int main() { | |
int a, b, n; | |
while(scanf("%d%d%d", &a, &b, &n) != EOF) | |
{ | |
printf("%d.", a / b), a = a % b; | |
for(int i = 0; i < n; i++) | |
{ | |
a = a * 10, | |
printf("%d", a / b), | |
a = a % b; | |
} | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment