Facebook
From Edgy Matamata, 6 Years ago, written in Plain Text.
This paste is a reply to Re: Untitled from Denim Crow - view diff
Embed
Download Paste or View Raw
Hits: 488
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(void) {
  6.        
  7. float L, P;
  8. int n;
  9.  
  10. jeszczeRaz:
  11.  
  12. cout << "Wprowadz lewa granice: L i prawa granice: P" << endl;
  13. cin >> L;
  14. cin >> P;
  15. cout << endl <<"Wprowadz ilosc zmiennych x" << endl;
  16. cin >> n;
  17.  
  18.         if(L < P && n > 10)
  19.                 continue;
  20.         else
  21.                 goto jeszczeRaz;
  22.                
  23.                 float *Tx = new float[n];
  24.                 float *F = new float[n];
  25.                
  26.                 float k = (P - L) / (n - 1);
  27.                
  28.                 float x = L;
  29.                
  30.                 for(int i = 0;i < n; ++i) {
  31.                        
  32.                         Tx[i] = x;
  33.                         F[i] = 3.5 * x * x + 8.2 * x + 1.3;
  34.                         x += k;
  35.                        
  36.                 }
  37.                                
  38.         delete[] Tx;
  39.         delete[] F;    
  40.        
  41.        
  42.         cin >> ignore();
  43.        
  44.         return 0;
  45. }

Replies to Re: Re: Untitled rss

Title Name Language When
Re: Re: Re: Untitled Social Elephant text 6 Years ago.