Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- struct Point {
- double x, y;
- };
- void GPS_Print(Point p) {
- printf("%f %f\n", p.x, p.y);
- }
- int GPS_IsNorth(Point p) {
- return p.y > 0 ? 1 : 0;
- }
- int GPS_East(Point p) {
- return p.x > 0 ? 1 : 0;
- }
- Point GPS_Read() {
- Point p;
- scanf("%lf %lf", &p.x, &p.y);
- return p;
- }
- int main(void) {
- Point p = GPS_Read();
- GPS_Print(p);
- printf("A(z) %s es a %s felteken van.",
- GPS_IsNorth(p) ? "eszaki" : "deli",
- GPS_East(p) ? "keleti" : "nyugati");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement