Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- float n, a, x, d, z;
- setlocale(0, "");
- cout << "Ââåäèòå êîëëè÷åñòâî âû÷èñëåíèé : \n";
- cin >> n;
- if (n < 0){
- n = -n;
- a = 1.5;
- x = -0.7;
- d = a / 5;
- }
- else {
- cout << "\nÂâåäèòå A : ";
- cin >> a;
- cout << "\nÂâåäèòå íà÷àëî ïîçèöèè Õ1 : ";
- cin >> x;
- cout << "\nÂâåäèòå øàã dX : ";
- cin >> d;
- }
- //cin>>a>>x>>d;
- cout << "\n\n";
- cout.width(2);
- cout<<"N";
- cout.width(6);
- cout<<"X";
- cout.width(8);
- cout<< "Y" << "\n\n";
- for (int i = 0; i< n;i++){
- z = -z;
- cout.width(2);
- cout<< (i + 1);
- cout.width(6);
- cout<<x;
- cout.width(8);
- cout<< z << "\n";
- x = x + d;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement