• Register
Welcome to JSTP Q&A, where you can ask questions and receive answers from other members of the community.

เขียนนาฬิกา sidereal อย่างไรดีครับ

0 votes
โครงงานผม ไม่ว่ายังไง ก็ต้องใช้นาฬิกาแบบนึงครับ เรียกว่า นาฬิกา sidereal ซึ่งจะเดินช้าไปประมาณวันละสี่นาที ใครพอจะอนุเคราะห์เนะนำวิธีเขียนได้มั่งครับ
asked 2 months ago by anonymous

2 Answers

0 votes
อ่า เดินช้า 4 นาที ก็คำนวณใหม่ว่า เวลาที่เดินช้าไปคิดเป็นกี่วินาที เทียบอัตราส่วนกัน 1 วินาทีมันจะกลายเป็น 1 วิกว่าๆ (ใช่เปล่าวะ) หลังจากนั้นถ้าจะทำนาฬิกาเองก็ต้องใช้การคำนวณจากมอเตอร์ แต่วัดยากนะ ให้ร้านเค้าทำน่าจะทำได้
answered 2 months ago by anonymous
0 votes

#include<stdio.h>
#include<conio.h>
#include<time.h>

main ()
{
char o;
int i,j,k,h,m,s,mo,d;
double sum;
long int su,se;
do
{

printf("\n\n\n\n\n\n+++++++++ ++++++++ +++++++++ +++\n");
printf("+ + ++ ++++++++ +++++++++ ++ ++\n");
printf("+ + ++ +++ +++ ++ ++\n");
printf("+ + ++ +++ +++ ++ ++\n");
printf("+ +++++++ ++++++++ +++ ++ ++\n");
printf("+ +++++++ ++++++++ +++ +++++++++++++\n"); 
printf("+ + ++ +++ +++ +++++++++++++++\n");
printf("+ + ++ +++ +++ ++ ++\n"); 
printf("+ + ++ +++ +++ ++ ++\n"); 
printf("+ +++++++ +++++++++ +++ ++ ++\n");
printf("++++++++ +++++++++ +++ ++ ++\n");
printf("\nWelcome to sidereal Clock Beta");
printf("\nsee new ver at tgom.exteen.com\n");

printf("Please insert Hour 1-24 \n");
scanf("%d",&i);
printf("Please insert Min 1-60 \n");
scanf("%d",&j);
printf("Please insert Sec 1-60 \n");
scanf("%d",&k);
printf("Please insert Day form 21/3 0-364 \n");
scanf("%d",&d);
sum=((i*3600)+(j*60)+k-(d*244));
printf("sum=%d",sum);
h=sum/3600;
su=sum-(h*3600);
m=su/60;
se=su-(m*60);
s=se; 
printf("\n\n");
printf("%d:%d:%d",h,m,s);
}
while (1=1);
}


เนี่ยอ่ะคับ โค้ตคอมไพล์ผ่านคับ แต่เป็นปัญหา สำหรับปีที่มี 366 วันคับ

answered 2 months ago by anonymous
edited 2 months ago by nattster
ใส่ case ได้ไหมครับ
ผมสงสัยอะครับว่าทำไม d*244 อ่าคาับ ทำไมไม่เป็น d*240
ผมเข้าใจอะไรผิดรึเปล่าเอ่ย?

ขอถามเพิ่มเติมอีกนิดอะครับ อันนี้คือผมไม่รู้อะครับ
ในตัวของ time.h มันจำเป็นต้องใช้ในโค้ดนี่เปล่าครับ ถ้าจำเป็นมันใช้ทำอะไรอ่าครับ

No related questions found