• С++ da sintaksis Pythonda sintaksis
  • C++da kod Pythonda kod
  • Rasm 3 c. Oddiy dasturning blok Sxemasi




    Download 15,08 Mb.
    bet22/135
    Sana22.05.2024
    Hajmi15,08 Mb.
    #250347
    1   ...   18   19   20   21   22   23   24   25   ...   135
    Bog'liq
    Fizik jarayonlarni kompyuterda modellashtirish

    Rasm 3 c. Oddiy dasturning blok Sxemasi.

    Dastur kodi С++ (Visual Studio):
    #include "stdafx.h"
    #include
    #include
    using namespace std;
    int main(){
    double x, y, U, V;
    cout<<"Klaviaturadan x ning
    qiymatini kiriting x=";
    cin>>x;
    cout<<"Klaviaturadan yni qiymatini
    kiriting y=";
    cin>>y;
    U=pow(x, 2.0)+(y+3.0)/(x-1.0);
    V=1.0/pow(y, exp(1.0))*pow(sin(sqrt(x)+1.5), 2.0);
    cout<<"pri x="<y=double(input("y ni kiriting: "))
    U=double(input("U ni kiriting: "))
    print("Klaviaturadan x ning qiymatini kiriting x="};;
    x=double(input("x ni kiriting: "))
    print("Klaviaturadan yni qiymatini kiriting y=");
    y=double(input("y ni kiriting: "))
    U=sqrt(x)+(y+3.0)/(x-1.0);
    V=1.0/e*ln(y, exp(1.0))*sqrt(sin(sqrt(x)+1.5));
    print(“x=”;x)
    print(“y=”;y)
    print(“u=”;u)
    O’hshash sintaksis konstruktsiyalar Python/C++

    С++ da sintaksis

    Pythonda sintaksis

    Har bir konstruktsiya C++da ; nuqta –vergul bilan tugashi kerak;

    Pythonda konstruktsiyalarga nuqta vergul quyilmaydi

    O’zgaruvchilarni e’lon qilinishi

    C++da kod

    Pythonda kod

    double a = 10.1;
    bool b = true;
    int c = 10;



    a = 10.1
    b = True
    c = 10




    Download 15,08 Mb.
    1   ...   18   19   20   21   22   23   24   25   ...   135




    Download 15,08 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Rasm 3 c. Oddiy dasturning blok Sxemasi

    Download 15,08 Mb.