Toggle navigation
Courses
Questions
Tags
Users
AC 20161201 第二次期中考 第二題
0
like
0
dislike
4.7k
views
時鐘上有時針有分針,分針每一分鐘跳一次,分針每跳一次時針也會前進相對應的角度。請設計一程式,由使用者輸入一個時間,程式會計算出時針與分針間的夾角後輸出。
輸入說明:輸入包含兩個正整數,兩個數之間由一個空白隔開,第一個數字代表時,第二個數字代表分。
輸出說明:請輸出時針與分針間較小的那個夾角。
輸入範例:
12 31
輸出範例
170.5
[Exercise]
Coding (C)
-
asked
Dec 1, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 18067 -
Available when:
2016-12-01 18:30:00
-
Due to:
2016-12-01 21:00:00
reshown
Dec 1, 2016
by
Shun-Po
|
4.7k
views
comment
Please
log in
or
register
to add a comment.
62
Answers
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include * * * * *
#include <ctype.h>
#include <math.h>
#include ** * * * * *
int main(){
*** ** ** ** * *** *** ** h,m;
* **** * * *** * * *** * **** * ****** * ** **** * **
* ****** ***** * ******** * arch,arcm,sum=0;
** ** * * ** *** * * * * *** * * *
* ** ** * ***** * * ** * * = m * 6;
* ** *** *** ***** **** = h * 30 + m * 0.5;
** * * * *** ** * * * ** > arch){
** *** *** ****** ** * * * *** *** ***** * = arcm - arch;
** ** * * * * * * * * * ****** ** ** * *
***** ** * * **** * *
* * * * * ** ***** * * < arch){
** *** *** * * * * **** * * * * ** *** * ** = arch - arcm;
***** * **** * ** ** * * *** *** * ******** *
* * * ** **** *
** ** * * * **** ****** * == arch){
* ** * *** ** * ***** * * ** **** * * ** **** * ** * * * *** * * **
** ** * ***** ** * **** ** *
* ** ** ** * ** * * 0;
}
answered
Dec 1, 2016
by
loyfree0706
(
-216
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include *** ** ** ***
#include * * * *** * ***
#include <ctype.h>
#include <math.h>
int main()
{
*** *** * * ** * * * ** a,b,c,d,e;
**** ** ***** *** ***** * * **** ** * ** * * **
** *** ** * ** * ** ** ** * ***** *
* *** *** * *** * * ** * ***
* * ** * * ** * *
*** * ** ** * ** * * * **
* ** ** * * ** * *** (c>=d)
** ** * * * *** * *
* *** ** * ** ** * * (c<d)
*** * ** ** * ** *
* * ** * **** **** (e>180)
* *** * * * * * ** * ** *****
* ***** * ** * ** * **** ***** *
* *** ** * * ** *** * *** ** 0;
}
answered
Dec 1, 2016
by
410523016
(
-136
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include ** * * *** *
int main()
{
* **** ** ** * ** * * * * * * ,j ,n=0;
* * ** ** ** ** ** i;
* ** * * * *** * *** ** ** *** * *** * ** **
* ****** *** ***** = i % 12 ;
* *** ** * * ** * =( i * 30 )+( j / 2) ;
*** ** * * * *** * = j * 6 ;
*** * ** * ** * * * =k-l ;
if(m < 0)
*** ** ** ** ** *
****** * * * * ** ** * * *** ** = - m;
*** *** * *** *****
* ** ** ** *** if(m > 180)
** * * ** * * ***
** * ** *** ** * ** ** * ** *** * = 360 - m ;
** *** **** * *
* * * ******* *** *** ** **** *
** *** ** ****** 0;
}
answered
Dec 1, 2016
by
ert5179693
(
-60
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>
int main()
{
***** * * h,m;
* * **** * ** * * * ang1,ang2;
** ** ** * * ** ****** * * *** *** **
* * ** ** *** *** ((30*h+0.5*m)>6*m)
* * * ** *
** *** ** ****** ** * ** *** ** * = (30*h+0.5*m) - 6*m;
** ***** ** *** * *** ** * **** *** ** = 360 - ang1;
* * ** *** ****** ** * * ** * * * (ang1 > ang2)
***** * * * ** * * * ** ** * * *** * ** * * *** *** *** * ** *
*** *** *** * **** * * * * * *
* ** * *** * * * *** * * ** ****** *** ** * * * *
* *** * **
* ** ****** ** *
** *** ** *
** * * * *** * ** * **** ** * = 6*m - (30*h+0.5*m);
* ** * *** * ** ** * * ** * ****** = 360 - ang1;
* ** ** ****** * ***** *** * * * * (ang1 > ang2)
**** * ** ** *** ** * ** * *** * * ** *** * * *
**** * * *** ** * ***** * * *** *
* ** **** ** **** * ** ** *** ** ***** * ** * * *** ** ** ** *
}
*** ** ** ** *** 0;
}
answered
Dec 1, 2016
by
莊長穎
(
-42
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include * * *** * ** *
* * *** * * ** *
int * ** *
* * ** ******* *** * a ,b ,i;
* ** * ** **** * **** c;
*** * * * * * * **** * * ** * * * **
******* * * * * * *** * ** * *
* * *** * ** * != 12)
* * ** * ** ** = b*6 - b*0.5- a * 30;
* * * * *** **** **
** ****** *** * * = b*6 - b*0.5;
** **** *** *** c * * 0 )
** * * * ** * ***** = -c;
** * * * * * * * *** ** **** c);
return 0;
}
answered
Dec 1, 2016
by
Doloa
(
-122
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include ** *******
int main()
{
* ***** ** ******* m=0,k=0,l=0 ,j ;
* * ** * i;
***** ** ***** ** ****** * * * ** *** * **
*** * * * * * * = i % 12 ;
** ** * **** * =( i * 30 )+( j / 2) ;
*** * *** ** = j * 6 ;
* * ** ** ** *** * =k-l ;
** ** ** * * *** ** < 0)
* ***** ** *
* * * ** * ** * * ****** ** *** ** * ** * = - m;
** * * * * **** **
***** ** ** ** ** * * if(m > 180)
** * *** ** **** **
*** * * **** * * * *** ** **** = 360 - m ;
** * * * **
* * ** ** ** * * * ** *
* * * * *** ** 0;
}
answered
Dec 1, 2016
by
ert5179693
(
-60
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
#include<stdlib.h>
int main(){
******* * * * **** a,b=0;
** * * * ** *** * *** ** c,d=0;
*** * ***** ** ** * ** * * ** ** * * * *
***** * *** * * ** ***** ** * *
* *** **** *** * * * * * *
** ** ******* *** * * ** *
**** ** * * *** * * * * *
** * ******* ** *** * * **
* * * * * ** ** ** * * * * ** ** *** * *****
}
** *** ** *** *** * **
** ** * * * *** * * * * * ** * * *** ** * *** * ** * * *
}
** ****** * * *** 0;
}
answered
Dec 1, 2016
by
SRFX
(
-140
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>
int main()
{
* **** ** ** * ** * *** *** * hour,min;
* * ** * * * ** ***** * d,k,a1,a2;
* * ** **** ****** * *** ** * * * ***** * ** * ***** *
** * * * *** *** * * * (hour==12)
** * * * **** * * *******
** *** * *** ***
**** * ** * *** *** ****** * *
*** * * * * * * *** ***
* * * * * * *** * * * *** **
** * ** ** * * * * **
** * ** *** **
* *** * ** * *** ** * *
** ** * * * * **
* * * * *** *** * **
* * ** * * ** *** ********** * **
* * *** * *** * ** * **** * ** * * * *** * ***
* * * ** * * * * * *
** ** * * * * ** *** ***** * ******* ** ****** *
* **** * * *** ** ** **
* ** * * * * *** * ** ** 0;
****** *** * **
* **** * * ** ** * * * * **
answered
Dec 1, 2016
by
Gulang
(
-122
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>
int main()
{
** * * * * ** **** * ** * a,b;
** ** ** * ** * ** * * ***** q,w,e;
*** * ** ***** ***** ** *** * * *** ** * * * * * ****
*** ** ** * ****** ****
{
* ** * ** * ** ** *** * * *** *** *** == 0)
* * ** * * ***** ** * * * ** * * * * * = 6*b - b/2;
**** * ** * **** * * ** ** **** ** * * * ** * * if(b%2 != 0)
* * **** ** * *** ** *** * * * ****** ** = 6*b - b/2 - 0.5;
** ** * ** * * * * **** * * * ** *** * * ** *
** * * *** ** ** ** * ** * * ** ** ** *** * = 360 - q;
* * * ** ** * *** ** *** ****** *** *** *** * * if(q<0)
* ** * *** *** * * * ** * *** ** * ** * * = 360 + q;
}
* ** ** * * * * ** **
{
* ** * * * ** * ** * * * *** * *** * == 0)
* ** ** *** *** * *** ** * * * * * = 6*b - b/2 - 30*a;
* * * * *** * * * * *** ****** ** * * * * * if(b%2 != 0)
* * * ** * ** **** ***** ** * *** ** *** * = 6*b - b/2 - 0.5 - 30*a;
** ** * ** ** * * ** * * * * * * *** * * ** **
** * * ******* * * * * * * * ** * ** ** = 360 - q;
** ** * **** * * * ** * **** * * ***** * ** ** if(q<0)
** * ** *** * * * * *** **** * * ** *** = 360 + q;
}
*** ** ** * * ** **** ***** * *** * *** **** **
** *** * **** ** * * ***** *** ** * *** * ***** ** ** * ** ***** * *** ** *
* * ***** * * ** * * * * * * * * * ** ******* ** if(w>q)
*** ** ** ** ** * * ** * * * **** ****** * ** * ***** *** ** *** * ** **
* *** * * **** * *** **** ** * ****** ** * = b%2;
*** *** * * ** * * * 0;
}
answered
Dec 1, 2016
by
410323020
(
-85
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
#include<stdlib.h>
int main(){
*** *** * * *** ** **** a,b=0;
*** *** * ** * ****** c,d=0;
** * * * ***** *** * * * * * * *
** * * ** ** *** * * * ** ******* * * ** **** ****
** ** *** ** **** * *
* * * * ** *** **
* **** * * ***** * * * * * * ** *
*** * * * ***** ** ** * ***** * * * *** ** *** * *** * * * * *
**** ****** ** * *
* * * ***** * * **
*** * * * * * * ***** **** * * * ** *** ***** * ** * * ** * * ****
}
** ***** * * * ** * *** 0;
}
answered
Dec 1, 2016
by
SRFX
(
-140
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
« prev
1
...
3
4
5
6
7
next »
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English
中文
Tiếng Việt
IP:172.69.59.114
©2016-2025
Related questions
0
like
0
dislike
16
answers
AC 20161201 第二次期中考 第五題
[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
|
2k
views
0
like
0
dislike
86
answers
AC 20161201第二次期中考 第四題
[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
|
6k
views
0
like
0
dislike
49
answers
AC 20161201 第二次期中考 第三題
[Exercise]
Coding (C)
-
asked
Dec 1, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 18070 -
Available when:
Unlimited
-
Due to:
Unlimited
|
3.5k
views
0
like
0
dislike
21
answers
AC 20161201 第二次期中考 第一題
[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
|
2.1k
views
0
like
0
dislike
0
answers
AC 20161201 第二次期中考公告
[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