Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ZimmGy-1.cpp : Defines the entry point for the console application.
- //
- //#include "stdafx.h"
- #include <iostream>
- //#include <cstdlib>
- //#include <cmath>
- using namespace std;
- double rect_area(double side_a)
- {
- return pow(side_a,2);
- //return side_a*side_a;
- }
- double point_rect_area(double* side_a)
- {
- return pow(*side_a,2);
- }
- //int _tmain(int argc, _TCHAR* argv[])
- int main()
- {
- std::cout << "Hello world" << std::endl;
- cout << "Egyenes zérushelyének meghatározása:" << endl;
- int a, b;
- cout << "A:";
- cin >> a;
- cout << "B:";
- cin >> b;
- if (a)
- {
- double c = -1.0*b/a;
- cout << "Eredmény: " << c << endl;
- }
- else
- {
- cout << "Nullával nem osztunk!" << endl;
- }
- cout << "Négyzet területének számítása" << endl;
- double a2;
- cout << "Négyzet oldala:";
- cin >> a2;
- cout.precision(2);
- cout << "Eredmény:" << rect_area(a2) << endl;
- cout << "Eredmény:" << fixed << point_rect_area(&a2) << endl;
- //cout.setf(ios::scientific);
- int* pt;
- pt=&a;
- printf("%d\n", a);
- printf("%d\n", *pt);
- printf("%p\n", pt);
- printf("%p\n", &a);
- //printf("Hello world!");
- //std::cin.get();
- system("Pause");
- return 3256;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement