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 <stdlib.h>
int main()
{
double a,b,c,d,e,k;
scanf("%lf",&a);
scanf("%lf",&b);
if(a == 12)
{
** ** * ** *** * * * * * ** *** ** * * * * * * * *** * * *** * = (b/60)*30;
* ** * *** *** * * ** * * *** ** **** * *** ** **** * **** * * = b*6;
* ** ** ***** ** ** ***** * * * **** * * * * *** * * ** ***** ** * ** ** ** = abs(d-c);
****** **** *** ** *** * * **** * ** ** * ** *** ** * * ** ** *
** *** * ******** * ** * *** * ** ****** *** ** * * * *** ***** ** * *** e<k)
*** *** * ** ** *** * ** * *** **** ***** * * **** * * * * * * *** ** * *
* **** * * * * * *** ** ** ****** * ** * ***** *** * * **** * ** ** ** ** *** ***** * ** *** * ** * **** *
* ** * *** * * ** **** ***** ** * * **** **** ** ** *** *** ** ** * **** ** ** *
* * *** * * ** * * ** ******* * * *** **** * * ** * ** * * * * ** ****** *
* * * ** *** * * * * * * * *** * **** * ** * * * ** ** * *** * * *** * ******* * * * * *
* * * ** * ** * * *** *** * * ** * ** *** *** * ***** ***** *** ** *** * *** * * *** ***** * ** ** * * * **
* ** ** *** * ** * **** *** * *** * ** **** ** * *** * ******** ** * * ** ** *** * ** *
}
else
{
***** * * ** ** *** *** * ** * * *** ** ** ** ** * ** ***** *** = (b/60)*30+(30*a);
* ********** * * * * *** ****** * ** * * **** ** ** ** * ** *** **** = b*6;
* ** * * * * ****** *** ** * * ** * *** * * * * * ** ** * **** ** ** = abs(d-c);
* **** * ** * * * * **** * * ** *** * **** ** ** *** * *** * **
*** *** * ******* ** ***** ** ** * ******** ** ******** * *** * ** * e<k)
*** * * ** ******* * * * ** ** ** * * * * ** **** ** * ***
**** * ***** * * ** ******** ** * * ** *** ** **** * * *** ** ** ** * ** * * *** * ** * ** *** * *** * ** * ** * ** ** * *** ***
* * * * * * * ****** * ** *** *** * * * ** * ** * * *** * *** * *** ** **** * * * * *
****** * * * * ** ** ** * * * * * * *** **** ** ** **** ** **** * ** *
** ** * ** * * * **** * **** * ***** *** ** ** *** * * * **** ** *** * *** ***
*** * * * * **** * * * * * ** **** ** ** ***** ** ** * * ** ** *** ***** ** *** ** ** * ** *** ** * *** * * *** ** * * * *
** * ** **** ** **** * * * * *** ** *** * * * *** ** *** * * * **
}
return 0;
}
answered
Dec 1, 2016
by
410523012
(
-158
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
***** * * * *
* * * *** *
** * ** ***** * *
#include <math.h>
int main(void)
{
* * * *** *** ** * * *** * * h, m, i, j;
** ** **** ** *** ma, ha, fin, a;
* * * ** * * *** * *** ** ** * * &h, &m);
* * * * * * * * * (h<=0 || h>12)
* ****** * * * ** ********* 0;
***** ** * ** * * *** * ** || m>60)
***** * ** * * *** * * * 0;
** * ** ** * ** ** != 12)
*** *** * * * * ** **** **
* ****** * *** ** ** * *** * ********** * ***** * i<= h-1; i++)
*** ** ** * * * *** * ** *** * *** *** ** = 30*i;
*** * * **** *** *
** *** **** * * * * ** * ** j<=m; j++)
* ** * * ** * * * * = 6*m;
* * * *** ****** * * = ha+0.5*m;
* ** * **** ** * * * * = ma - ha;
********* * * *** *** ***
** ***** ******* * * * * ****** ****** * * = 360-a;
* * * *** *** *** * **** ** *
* ** * * ** * * * ** **** * * * * ** ** ** *** * = a;
** *** ** ** * * * * < 0)
*** **** *** * * *** ** * ** * ** ** **** * -fin;
* * * ***** * * * **** *** ** *** *** ** ** fin);
*** * * * * * * * ** 0;
}
answered
Dec 1, 2016
by
paulinelyq
(
-64
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
** * **** * * * *
***** ** **** * * **
int main(void)
{
* * ***** * ** * * * h, m, i, j;
* ** * ** * ** * * * *** * ma, ha, fin, a;
* * *** * * ******* * &h, &m);
** * ******* * *** ** * * (h<=0 || h>12)
* * ******* *** **** * 0;
* ** * * * * ** || m>60)
* * * ** * * ** ** * 0;
* * *** * * * * ** * != 12)
* * * ** ** **** * * ** *
***** * ** * * ** ** ** * * * ** *** * * i<= h-1; i++)
*** * ** * ** * * * *** *** **** *** = 30*i;
*** * ** ** * ** *** *** *
** *** ** ******* * * ** * j<=m; j++)
* **** *** ** ** ** = 6*m;
*********** *** ** ***** = ha+0.5*m;
**** * * * * * ** * = ma - ha;
* ****** ** ** *** ** ** **
**** * * ** * *** ** * *** *** ***** * = 360-a;
* ** * * * ** * ****
* * ** * *** * * * * * * * *** *** **** = a;
** * *** ** ** * ** * * * * *** ** **** fin);
* * * ** *** *** ** * 0;
}
answered
Dec 1, 2016
by
paulinelyq
(
-64
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
* ** * ** ***** *
* * ** *
int main(void)
{
* **** * ** * ** ** * h, m, i, j;
* * *** * ** ** * * * ** ma, ha, fin, a;
* * * * * *** * * * *** *** *** * &h, &m);
** * * * * **** * *** * (h<=0 || h>12)
* * * **** *** 0;
* * ** * **** *** * ** ** || m>60)
** * * ** * * ** ***** *** 0;
* * ** * * * *** ** * ** ** i<= h-1; i++)
** * *** * *** * * ** * * = 30*i;
****** * ****** * ** * j<=m; j++)
* *** *** * * * * ** *** = 6*m;
** * ** ** * * * = ha+0.5*m;
******* * ****** *** * * * * ** * ha);
* * *** * * * ** * *** * * **** *** ** * * ma);
* ** * ***** * **** * * = ha - ma;
* ** * * * * ****
**** * * * * * ** *** ** * * * ** * ** = 360-a;
** * ** * *** * * **** * **
** * **** * * ** *** * ***** ** * * * ** = a;
*** ** *** ** * * ** * * * ** fin);
*** ** ** * * ** * * ** 0;
}
answered
Dec 1, 2016
by
paulinelyq
(
-64
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include * * * * *
#include <math.h>
int main()
{
** ** * * **** * ****** i,j,h,m,r,a;
*** * * ** ******** *** ** * * *** ** *
* *** ** * *** * * **
* * * * ***** ** *
* * ** **** ** * * * * *** * *** *
if(m-h>180)
* * * * * *** ** ** ** * ** ** *
* *** *** * *** ** **
* *** ** * * ** ** * * ********
* * * ** ** *** *** * **
** **** *** * ********* * *** * * *** ** ** * ** * * ** *
return 0;
}
answered
Dec 1, 2016
by
羅祖嘉
(
-248
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
** *** ******** **
* ** ** *
* *** ** ** *
float main()
{
float h=0, m=0, i=0;
** * * * ** ** * ** * * ,&h);
*** ** * * ***
* ** ** **** * * ,&m);
*** ***** *
**** ** * * ** * * * * ** * ***** *
* ****** ** *** * **** **** ** * 5.5*m-30*h;
** * ** * *** * * * * *
* * ** * ***** **** ** * **** * 30*h-5.5*m;
else
**** * * *** * ** * * * *
* * ** * * * **** * * ** ** * * ** * ** ** *
* *** ****** * ** *
** * * * ** * * *** * * *** * * * ****
*** ***** * * ** * **
* *** ** **** *** * * * * * * * ,i);
else if(i<0)
** ** *** ** * * * ** * * ** * * ,i);
else
* **** * **** *** ** * *** * ** **** ,360-i);
** ***** ** 0;
}
answered
Dec 1, 2016
by
410523030
(
-34
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
* ** *****
* *** * * *** * *
* *** * * **
* **** ** * ** * *
** ( )
*
* **
*** ***
* ** * ***** ******
** ** * * **** ** **
* (a = * {a = *
d = *
e = ** ****
% 2 != **
* = d - *
* *** * = - * ** * * ** * *
*
** * = d - * ***** ***** * ** ** ** ** * *
*
* *
}
answered
Dec 1, 2016
by
410523022
(
-276
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
* **** ***** ** ***
answered
Dec 1, 2016
by
410523022
(
-276
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include ** * *** *
#include * * ** ** *
#include * *
int main()
{
** ** ** * ** *** ** i,j,h,m,r,a;
* ** * * ** ** ** ** ** * ***
* *** * *** * ** *** * * ***
* ** * * * * **** * *** **
*** ** *** * ** * * **
if(m-h>180)
* **** ****** *** *** *** ** **** ***
*** **** * ** **** *
* * *** * ** ** ** * * * ** * * * * * ** *
return 0;
}
answered
Dec 1, 2016
by
羅祖嘉
(
-248
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>
#include<math.h>
int main(void)
{
* * ** ************ * ***** a=0,d=0,b=0;
** * ** * * ** **** ** e=0,g=0;
* ** ** * * * ** * * * *** * ** **
** * ** * ****** *** * ** * * **
*** *** * ** ** ** *** **
* * * * * * * * **** if (a==1)
* * ** * *** *** * ***** *
* ** * *** **** ** **** * if (a==2)
** *** * * **** ** * *
*** ****** * * * * * * **** if (a==3)
* *** * ** **** * * *
******* * * ** ** * * if (a==4)
* ** * * ** **** * * **
****** * * ** * ** * ** if (a==5)
*** ** ** ***** * ** ***
**** ** ** * **** * * * * * if (a==6)
* * * *** ***** * *
* * * ****** ****** * ** if (a==7)
* ** * * **** * * ** ** *
* * * * * * ** * * if (a==8)
* * * ** *** *****
** * ** * *** * if (a==9)
****** *** * * * *** * * *
** ** ** ** * * ** if (a==10)
** * * * ** *
** * *** ** * **** ** * if (a==11)
** * * ** * *** * * * * ***** *
* ** *** ** ***
*** * * ** *** **
* * * * * ** *** *** ** * ** ** *
** * ****** ** ** * ******* *
* **** * ** * * * * *** **** *** ****** *
*** * ** ***** ** * * if(b<=59)
* *** * ** ** * * **
*** ** * * * * * * ***
** ** * * * ** ** * ***** ****** **** ** ***
* **** ***** * * ****
* * ** ** * ** * 0;
}
answered
Dec 1, 2016
by
蘇瑋朝
(
-8
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
« prev
1
2
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.70.130.159
©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
|
2k
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