Toggle navigation
Courses
Questions
Tags
Users
AC 20161201 第二次期中考 第一題
0
like
0
dislike
4.9k
views
請設計一個程式,由使用者輸入一個十進位的數後再輸入想要轉換成的進位制,程式會將他轉換後輸出。
輸入說明:輸入的第一個數是一個十進位的數,接著會輸入一個正整數N代表要轉換的進位制。兩個數之間會用一個空白格開。
輸入範例:
10 16
輸出範例:
A
[Exercise]
Coding (C)
-
asked
Dec 1, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 18066 -
Available when:
2016-12-01 18:30:00
-
Due to:
2016-12-01 21:00:00
reshown
Dec 1, 2016
by
Shun-Po
|
4.9k
views
comment
Please
log in
or
register
to add a comment.
21
Answers
0
like
0
dislike
Hidden content!#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
int main(){
int n,m,i=0,l;
** * * * **** ** * * * *** **** t[50];
*** * ** * * * * * * ** ** **** %d",&n,&m);
** * * * * **** * * * * * * ** != 0){
* * * * *** *** * * **** ** * * ** * * * ** * ******** >= m){
* ***** * ** * * ** ** *** ** * * * ** * * * * * * ** ** ** ** * * = n%m;
* * * * ** ** * * ** ** ** * ** ** * **
* * ** * * ***** * * * * ** * * ** * *
* ** * * ** ** * * ** * ** * * *** * * * ** * * * * * * * *** ******* * = n;
* **** ** * * * * ** * * * * * ** * * * * ** ** * **
** * * * ** * ** ** ** * * * ** ** * * ** * * * ** * * * 57){
// * * * * * * * * * * * * *** * * * ** *** ** ** * * * * * *** * * * * * *
* * **** **** ** * *** * * * * *** ** ** *** **** **** * * * * * * * * * = (t[i] +55);
* ** * * * ** ** * * * * ** * * ** * *
* **** ** * * ** *** * * * ** ** * ** **** * * *
// * * * *** * * * ** * **** ** ***** ** * * * * *** * **** * * * ** * * * ** ***** *
** ** * * * * ** * * * * * *** **** * * * *** * * * *** * ** ** * * * = (t[i] + '0');
** * ** * * ** * * ** * * ** ** * * *** ** *
* * * ** ** * * * ** * ** * * **** * * = n / m;