Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
2.1 kB
3
Indexable
Never
#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

double g1 = 1.0;

void df(double A[], double &ans, int x, char s[]);

//Console Output:
//g1(side 1) =1 
//B[1] =2  
//s =bbb?w 
//ans(funk) =garbage --uninitialized  
//z =garbage ---unitialized 
//g1(funk) =1 
//z =1 
//y =2 
//g1(side 2) =7.7 
//B[1] =9 
//ans=1 
//s =bbb?w 
//ans(funk) =1 
//z =garbage -- uninitilialized 
//g1(funk) =1.7 
//z =1 
//g1(side 3) =7.7 
//B[1] =16 
//ans =4.5 
//y =.7.6.5.4.3.2.1.0 


//Table:
//B/A   |2 (li 54)  | 9  (li 56)   | 16 (li 68)
//ans | 1 (li 56) | 4.5 (li 68)
//g1  | 1 (li 7)  | 7.7 ( li 56) | 1.7 (li 66) | 7.7 (li 68)
//str | bbb?w (li 56)
//y   | 2 (li 51) | 7 (li 77)    | .7.6.5.4.3.2.1.0 (li 81)
//z   | 1 (li 111)
//x   | 1 (li 116)
int main() {
    
    int i;
    
    char str[100];
    
    double B[5] = {1.0,2.0,3.0,4.0,5.0};
    
    double ans;
    
    int y = 2;
    
    cout << "\ng1(side 1) " << g1;
    
    cout << "\nB[1] = " << B[1];
    
    df(B,ans,y,str);
    
    cout << "\ny = " << y;
    
    cout << "\ng1(side 2) = " << g1;   
    
    cout << "\nB[1] = " << B[1];
    
    cout << "\nans = " << ans;
    
    g1 = 1.7;
    
    df(B,ans,y,str);
    
    cout << "\ng1(side 3) = " << g1;
    
    cout << "\nB[1] = " << B[1];
    
    cout << "\nans = " << ans;   
    
    y = 7;
    
    cout << "\ny = ";
    
    while(y < 8) {
        
        cout << ".";
        
        cout << y;
        
        y--;
        
        if( y < 0 ) break;
    }
}

void df(double A[], double &ans, int x, char s[]) {
    
    int i, z;
    
    for(i=2;i>=0;i--) s[i] = 'b';
    
    s[5] = 'w';
    
    cout << "\ns = " << s;
    
    cout << "\nans(funk) = " << ans;
    
    cout << "\nz = " << z;
    
    cout << "\ng1(funk) = " << g1; 
    
    ans = A[1]/x;
    
    z = 1.0;
    
    g1 = 7.7;
    
    x = 1;
    
    A[1] += 7.0;
    
    cout << "\nz = " << z; 
}

Leave a Comment