[ create a new paste ] login | about

Link: http://codepad.org/3gQJi7xQ    [ raw code | output | fork ]

C, pasted on Jan 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>(Заголовочный файл cstdio обеспечивает выполнение операций ввода/вывод)
#include <math.h> 
void main()
 { double x, y, r, fi; (15.22.55.12.5)
    printf("\n X = "); 
    scanf_s("%Lf", &x); 
    printf(" Y = "); 
    scanf_s("%Lf", &y); 
    if (x) fi = atan(y / x); 
    if (x < 0 && y >= 0) fi += M_PI * 2; 
    else if (x < 0) fi += M_PI; 
    else if (!x && y > 0) fi = M_PI_2; 
    else if (!x && y < 0) fi = (3 * M_PI) / 2; 
    else if (!x && !y) fi = 0; 
    r = sqrt(x * x + y * y); 
    printf("\n r = %f\n fi = %f rad\n", r, fi); 
    _getch(); 
    return 0; 


Output:
1
2
3
4
5
6
7
Line 18: warning: extra tokens at end of #include directive
Line 24: error: too many decimal points in number
In function 'main':
Line 5: error: expected ';' before 'printf'
Line 18: warning: 'return' with a value, in function returning void
Line 18: error: expected declaration or statement at end of input
Line 4: warning: return type of 'main' is not 'int'


Create a new paste based on this one


Comments: