Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
mialte
/
kodutoo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ff61e91e
authored
a month ago
by
mialte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4
parent
90ead976
master
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
4
4
0 → 100644
View file @
ff61e91e
/*
Koostage programm, mis küsib kaugust Maast Kuuni.
Seda küsitakse seni, kuni vastus ei erine õigest rohkem kui 5%.
Iga vastuse juures andke vihje, kas õige vastus on pakutust väiksem või suurem.
Vastuse 0 sisestamine tähendab vastamisest keeldumist.
*/
#include <stdio.h>
#include <math.h>
int main() {
double arvamus, veaprotsent;
printf("Arva kaugus maast kuuni (km): \n");
scanf(" %lf", &arvamus);
veaprotsent = fabs((arvamus - 384400.00) / 384400.00);
printf("Veaprotsent: %.5f\n", veaprotsent);
if(0<veaprotsent<0.1){
printf("6ige!");
} else if (arvamus>384400.00) {
printf("Vale, proovi v2iksem arv. \n");
} else {
printf ("Vale, proovi suurem arv. \n");
}
return 0;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment