0 like 0 dislike
9k views
時鐘上有時針有分針,分針每一分鐘跳一次,分針每跳一次時針也會前進相對應的角度。請設計一程式,由使用者輸入一個時間,程式會計算出時針與分針間的夾角後輸出。

輸入說明:輸入包含兩個正整數,兩個數之間由一個空白隔開,第一個數字代表時,第二個數字代表分。

輸出說明:請輸出時針與分針間較小的那個夾角。

輸入範例:

12 31

輸出範例

170.5
[Exercise] Coding (C) - asked in 2016-1 程式設計(一)AC by (18k points)
ID: 18067 - Available when: 2016-12-01 18:30:00 - Due to: 2016-12-01 21:00:00

reshown by | 9k views

62 Answers

0 like 0 dislike
Hidden content!
#include *** ***** **

#include ** * *

#include * ** ** **

#include * ** ***

int main1(void)

{
* * **** * * * i,j,h,m,r,a;
* * * * ** * ** *** * ** ** ***
***** ** * **** * ** *** ,&j);
*** * *** ** **** * * ** **


* * * *** * *** * * ***
** * * * ** * ***** **** ** *


*** * *** * * ** **** *** * * ******* * *** ****

return 0;

}
answered by (-248 points)
0 like 0 dislike
Hidden content!
* * *** * *

#include ** ** ******* *



main(){

int * **** *
*** ** *** **** * ** ****
* ** * ** * **
** * * ** *** * *

sa=6*b;
********** *

g=ha-sa;


** * * *
** *
* * * * *

else if ** * ** *
******* * ** * *

else
*******
* * *** * * * * * **



return 0;





}
answered by (54 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



int main()

{
* ****** * * * * * * * ** a,b;
* ** * * q,w,e;
* * * ****** **** * *** ** ****** *** *** *** ** **
* *** * ** ** * *** ** * == 0)
* * ** ** ***** ** * * ** *** ** * = b/2;
* * * **** *** * * if(b%2 != 0)
** *** * ** * ** * **** *** ** * * ** * * = b/2 + 0.5;
* * * ** * (a != 12)

    {
*** * *** * *** * * * ** *** ** ** * * *** * (a*5 >= b)
* ***** **** *** * * * * ***** * * ****** **
*** * * ** * * * ** ** * ** ***** * *** ** * ** ** ** * ** = a*30 + e - 6*b ;
*** * ** * * * * *** ** *** ** *
* ***** * * **** ****** * ** *** ** * * * if (a*5 <b)
****** * ** * * ** *** * * ** * ** * ** * *
* ** **** ** * *** * * ** * *** * ** **** * * *** * * = 6*b - e - a*30 ;
** *** * * * ** * **** * ** ** ** * *** * * *

    }
*** * *** * *** ** * * *** if (a == 12)

    {
* * ***** *** * * *** ** * * ** * * ** * (b < 10)
* * ******** **** *** * ***** ** ** * ** ***
* *** * * *** ** * ** ***** * ** * ** * ** * ** * ** *** = e - 6*b ;
* * * * *** *** * * ******** ** * ** ** * ****
* * ** * * * * * * ***** ** ** * ** if (b >= 10)
* * *** * * *** * ** *** ** * ** **
*** *** ** ** * * * * * ***** * ** * ***** * ** * ***** * ***** * * = 6*b - e ;
** *** * *** *** *** * * * *** **** ** ***

    }
**** ** * ** ***** * *** * * *
* ** * ** * * * ** ** * * *** 0;

}
answered by (-85 points)
0 like 0 dislike
Hidden content!
*** ** * * * *
* ** ** **** *
* *** *** * ** *




** ** ** main()



{


* **** * h=0, m=0, i=0;


* * * ***** ***** * ** * ,&h);
** ** * * * * ** * * **
* * ** ******* * ,&m);
* * *** ** *
** ** ** * 5.5*m-30*h;
* * *
*** ***** * ** *** ** *


* *** * ** ***
** ** * ** * * ** * **** *** ** ** **** **** ,i);

 else
** ** * * * ** * ** ** ** * ** *** ** * * ,360-i);


**** ** * 0;

}
answered by (-34 points)
0 like 0 dislike
Hidden content!
//  Created by HoMingJui on 2016/11/3.

//



#include *** * * ** *

#include * *** * * **

#include * **** *** *

#include <math.h>





int main(){
*** ** *** ** ** * * a,b;
* ** * ** * ** *** * ** * xa=0,xb=0,ans=0;
** *** ** * * * ** * * * *** * * * * ** * ** ** ****
*** * * * ** * ****** ****
* *** * *** ** ** * * * ** * ** * * * ** *
* * * *** ** ** ** * *
* * ***** *** *** *** **
* * ** ** * ** ** * *** * ***
*** *** ** * ** *** ** ** * **
* ** ** *********** ***** * *** * *** * ** **
** ** ** * **** **** ***** *** 0;

}
answered by (-126 points)
0 like 0 dislike
Hidden content!
//  Created by HoMingJui on 2016/11/3.

//



#include <stdio.h>

#include ** *** ** * *

#include ** * * * **





int main(){
******* ** * ** * * * **** ** a,b;
**** * ** ** * ***** ** xa=0,xb=0,ans=0;
* ** * ** ** * *** * *** * ** ** * **
***** * * * ** * ** * * ** ***
* *** ** * *** *** **** *** * ** *** ** **
*** * ** * ** *** **
** * * *** * **** **** * * ** *
* * * ** **** *** ** * ** *
** * *** * ** * * * **
* *** * ** ** ** * * * * * * * *
** ** ** * ******* * ***** * 0;

}
answered by (-126 points)
0 like 0 dislike
Hidden content!
//  Created by HoMingJui on 2016/11/3.

//



#include <stdio.h>

#include ** * * ***

#include * * * *** * *





int main(){
* * ** * **** * ** a,b;
* * * * ****** * ** * xa=0,xb=0,ans=0;
*** * * * ** * ** * ** **** ** * **** * ** ** ** *
** * * *** *** * ** * ****
**** * * ** * * * * * * ********** * *
* *** **** * * * * ** * * *
* * *** **** * * ** * ***
* *** ** ** ** *** *** * ** *
* * ** *** * * * ***** * *** * *
** ** * * ** * * ****** ** * * %f * ** * *
**** * * * * ** * 0;

}
answered by (-126 points)
0 like 0 dislike
Hidden content!
# include <stdio.h>



int main ()

    {
*** *** ** * ******* ******** **** ** * ** m,h,a;
** * * * ** ** * **** * ********* ** ** ** ("%f%f",&h,&m);


** * * *** * * * * ** ** * * * * ** * * ** * ** * *


* *** * ** ***** * * ** *** * ** * **** ** ** *** * *
***** * ** ** ******* *** ** ** *** * * ** ** * ****
*** *** ****** * ** ** * ** ** ** ****** * ******** ** ** **** * **
** * * ** ** * *** ** *** * ** *** *
* * ******* * ***** ** * *** **** * ** ** * * *
****** ** *** * ** * * * *** ** * * * **
**** * ****** * * * * * *** * *** ** * ******** * *********** * * ***
**** *** ** * ***** * * *** * *** **
**** ** *** * * * * * ** * ** *** * ***** ***** ** * **

    }
answered by (-162 points)
0 like 0 dislike
Hidden content!
#include * ** * **** *

#include ** *** * **

#include * * ** * *

int main()

{
* * * * * ** ** * * a, b, c, d, e, f, g;
*** ** * * * ** ** *** * * * * * * * * *
* ** * * **** * (a = 12)

{
* * *** *** * * * * *** * ** = 0;

}
* * ** * ** ** *

{
** **** * * *** ** * * ** ** * * = a * 30;

}
*** ** * * * * = c + b/2;
*** * *** * = b * 6;
* * *** * * * ** = abs(d - e);
* *** * *** = abs(360 - f);
*** * * * ** (f > g)
** ** * ** * * ***** ** * * * * ** * ** * ** *** * * * g);
** * ***** *** * **
**** * * ** *** * * ** ** ** * * * * f);
* * ** * ** * * * ** * * 0;

}
answered by (46 points)
0 like 0 dislike
Hidden content!
# include <stdio.h>



int main ()

    {
** * ** ** **** * ** * * ** ** * ** * * * * ** * m,h,a;
* *** *** * ** * ***** **** ** ** * ** ("%f%f",&h,&m);
*** ** * * ** *** ** ** ** ** *** * * **** ** (h=12)
* * * ****** * ***** ** ***** ** * * *** * ****
* * * ** * ** ** * * ** * ** * ** * * ******** *** * * * ****
* * ** ***** ** ** ** *** ** * * * **


***** ***** * * ** *** *** *** **** ** ***** ****


* *** *** * ** ** * * * * * ** ****** * ***
** * ******* *** * * * *** **** *** * *****
* *** ** *** ** * ** *** **** ** * * * ** * * * * ** * * ** ***** * *
** ** ** * * * * * ** * ** *** * * ** * * * ***
* * ** * * ** ***** * * * ** * * * *** ** * ** * * **

    }
answered by (-162 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.100.18
©2016-2026

Related questions

0 like 0 dislike
16 answers
[Exercise] Coding (C) - asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18075 - Available when: 2016-12-01 18:30:00 - Due to: 2016-12-01 21:00:00
| 3.4k views
0 like 0 dislike
86 answers
[Exercise] Coding (C) - asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18071 - Available when: 2016-12-01 18:30:00 - Due to: 2016-12-01 21:00:00
| 11.4k views
0 like 0 dislike
49 answers
[Exercise] Coding (C) - asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18070 - Available when: Unlimited - Due to: Unlimited
| 6.5k views
0 like 0 dislike
21 answers
[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
| 3.9k views
0 like 0 dislike
0 answers
[Resource] asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18085 - Available when: Unlimited - Due to: Unlimited
| 10 views
12,783 questions
183,442 answers
172,219 comments
4,824 users