Username:
Password:

Hello Guest


If you want to join in our community , please register or login , you have in header a login form , or if you want to register ,press me .
  • Forum
  • Forum
  • Forum
  • Forum
  • Forum
  • fmSoftware is for sale , if you want to buy the forum and/or the old themes , jaques.gfx skype or roby_cs_reax@yahoo.com for EMAIL.

    You are not connected. Please login or register

    View previous topic View next topic Go down  Message [Page 1 of 1]

    Zyon

    Posts : 272
    Points : 1711
    Thanks : 2
    manager

    Hey, why I have my posts of before, but there haven't my, and other tutorials and odher, and I'm not in staff any more???

    Zyon

    Posts : 272
    Points : 1711
    Thanks : 2
    manager

    Oh, I'm find my old posts and tutorials.
    And I'm find old forums. :)

    Sasori

    Posts : 311
    Points : 1742
    Thanks : 5
    Administrator

    Hello , the old forums are still on forum but are hidden , so I will come back with the tutorials and stuff back .
    Topic locked !

    Sasori

    Posts : 311
    Points : 1742
    Thanks : 5
    Administrator

    void citire(int v[],int&n)
    {
    int i;
    cout < < "n= ";cin > > n;
    for(i=0;i {
    cout < < "a[" < < i < < "] =";cin > > a[i];
    }
    }void afisare(int v[],int n)
    {
    int i;
    for(i=0;i < n;i++)
    {
    cout < < a[i] < < " ";
    }
    }
    void inserare(int v[],int&n,int p,int val)
    {
    int i;
    for(i=n-1;i > =p;i--)
    {
    a[i+1]=a[i]
    }
    v[p]=val;
    n++;
    }
    void stergere(int v[],int n,int p)
    {
    int i;
    for(i=p;i < n-1;i++)
    {
    v[i]=v[i+1];
    }
    n--;
    }
    void ordonare(int v[],int n)
    {
    int i,j;
    for(i=0;i < n-1;i++)
    for(j=i+1;j < n;j++)
    if(v[i] > v[j])
    swap(v[i],v[j]);
    }
    void cautarebin(int v[],int n,int val)
    {
    int st,dr,mijl,gasit;
    st=0;
    dr=n-1;
    gasit=0
    while(st < =dr && gasit!=1)
    {
    mijl=(st+dr)/2;
    if(a[mijl]==val) gasit=1;
    if(val < a[mijl]) dr=mijl-1;
    else st=mijl+1;
    }
    if(st > dr) cout < < "Elementul cautat nu se afla in sir";
    else cout < < "Elementul cautat se afla in sir";
    /**
    sau
    if(gasit==0) return 0;
    else return 1;
    */
    }void interclasare(int a[],int n,int b[],int m,int c[])
    {
    int i=0,j=0,k=0;
    while(i if(a[i] c[k++]=a[i++];
    else c[k++]=b[j++];
    while(i c[k++]=a[i++];
    while(j c[k++]=b[j++];
    }/**
    cmmdc si cmmmc :

    void main()
    {
    int a, b, r;
    cin > > a > > b;
    r=a % b;
    while(r!=0)
    {
    a=b;
    b=r;
    r=a % b;
    }
    cout < < b;//cmmdc
    cmmmc(a,b) = (a*b) / cmmdc(a,b //cmmmc
    }

    nr prim :

    for (int i=1; i < =n; i++)
    {
    if (n%i==0)
    c++;
    }
    if (c==2) cout < < "Numarul este prim";
    else cout < < "Numarul NU este prim";
    return 0;
    }

    pb inserari :
    int main()
    {
    int a[100],n,i,j,p,d,k,c;
    cin > > n;
    for(i=0;i < n;i++)
    cin > > a[i];
    for(i=0;i < n;i++){c=0;
    for(p=2;p < a[i];p++){
    k=1;
    for(d=2;d < =sqrt(p);d++)
    if(p%d==0) k=0;
    if(k){
    for(j=n-1;j > i+c;j--)
    a[j+1]=a[j];
    a[i+c+1]=p;
    c++;
    n++;
    }
    }i+=c;
    }
    for(i=0;i < n;i++)
    cout < < a[i] < < " ";
    return 0;
    }

    pb stergeri:
    int main()
    {
    int a[100],n,i,j,x,y,d,s;
    cin>>n;
    for(i=0;i < n;i++)
    cin > > a[i];
    for(i=1;i < n-1;i++){
    x=a[i-1];
    y=0;
    while(x)
    {
    y=y*10+x%10;
    x/=10;
    }
    s=0;
    for(d=1;d < a[i+1];d++)
    if(a[i+1]%d==0) s+=d;
    if(a[i-1]==y&&a[i+1]==s){
    for(j=i;j < n-1;j++)
    a[j]=a[j+1];
    n--;
    }
    }
    for(i=0;i < n;i++)
    cout < < a[i] < < " ";
    return 0;
    }

    interclasare dupa proprietate :
    #include
    using namespace std;
    void interclasare(int a[],int n,int b[],int m,int c[])
    {
    int i=0,j=0,k=0;
    while(i < n && j < m)
    if(a[i] < b[j])
    c[k++]=a[i++];
    else c[k++]=b[j++];
    while(i < n)
    c[k++]=a[i++];
    while(j < m)
    c[k++]=b[j++];
    }
    void div5(int a[],int a1[],int&n)
    {
    int i=0,contor=0;
    for(i=0;i < n;i++)
    if(a[i]%5==0)
    a1[contor++]=a[i];
    n=contor;
    }
    int main()
    {
    int a[20],b[20],a1[20],b1[20],c[40],n,m,i,j,k=0;
    cout < < "n= ";cin > > n;
    cout < < "m= ";cin > > m;
    for(i=0;i < n;i++)
    {
    cout < < "a[" < < i < < "]=";cin > > a[i];
    }
    for(j=0;j < m;j++)
    {
    cout < < "b[" < < j < < "]=";cin > > b[j];
    }
    div5(a,a1,n);
    div5(b,b1,m);
    interclasare(a1,n,b1,m,c);
    for(k=0;k < m+n;k++)
    cout < < c[k] < < " ";
    return 0;
    }


    sortare prime :
    #include < iostream >
    #include < algorithm >
    #include < cmath >
    using namespace std;
    int main()
    {
    int n,a[100],b[100],i,j,p,x,d;
    cin > > n;
    for(i=0;i < n;i++)
    {
    cout < < "a[" < < i < < "] =";cin > > a[i];
    p=1;
    x=a[i];
    if(x==0 || x==1) p=0;
    else if(x>2 && x%2==0) p=0;
    else for(d=3;d < =sqrt(x);d+=2)
    if(x%d==0) p=0;
    b[i]=p;
    }
    for(i=0;i < n-1;i++)
    for(j=i+1;j < n;j++)
    if(b[i]==1 && b[j]==1 && a[i] > a[j] || b[j]==0 && b[i]==0 && a[i] {
    swap(a[i],a[j]);
    swap(b[i],b[j]);
    }
    for(i=0;i < n;i++)
    cout < < a[i] < < " ";
    return 0;
    }

    */

    for(i=0;i < n;i++)
       for(j=i-1;j > = 0;j--)
           if(a[i]==a[j])
           {
           for(k=i;k < n-1;k++)
               a[k]=a[k+1]
           n--;
           break;
           }
           
           
    diferenta :
    #include
    using namespace std;
    int main( )
    {
     int n, m, i, A[100], B[100];
     cout < < "n="; cin > > n;
     for(i=0;i < n;i++)
     {
         cout < < "A[" < < i < < "]=";
         cin > > A[i];
     }
     cout < < "m="; cin > > m;
     for(i=0;i < m;i++)
     {
         cout < < "B[" < < i < < "]=";
         cin > > B[i];
     }
     cout < < "A={";
     for(i=0;i < n;i++)
         cout < < A[i] < < " ";
     cout < < "}";
     cout < < endl;
     cout < < "B={";
     for(i=0;i < m;i++)
         cout < < B[i] < < " ";
     cout < < "}";
     int ok, j, k3=0, E[100];
     for(i=0;i < n;i++)
     {
         //se cauta A[i] in vectorul B
         ok=0; j=0;
         while(j < m&&!ok)
            if(A[i]==B[j]) ok=1;
                else j++;
         if(ok==0) E[k3++]=A[i];
     }
     cout <  cout < < "Diferenta: " < < "E={";
     for(i=0;i < k3;i++)
         cout < < E[i] < < " ";
     cout < < "}";
    }

    reuniunea:
    #include< iostream >
    using namespace std;
    int main( )
    {
     int n, m, i, A[100], B[100];
     cout < < "n="; cin > > n;
     for(i=0;i < n;i++)
     {
         cout < < "A[" < < i < < "]=";
         cin > > A[i];
    }
     cout < < "m="; cin > > m;
     for(i=0;i < m;i++)
     {
         cout < < "B[" < < i < < "]=";
         cin > > B[i];
     }
     cout < < "A={";
     for(i=0;i < n;i++)
         cout < < A[i] < < " ";
     cout < < "}";
     cout < < endl;
     cout < < "B={";
     for(i=0;i < m;i++)
         cout < < B[i] < < " ";
     cout < < "}";
      int ok, j, k2=0, D[100];
     for(i=0;i < n;i++)
         D[k2++]=A[i]; //se adauga elementele vectorului A in vectorul D
     for(i=0;i < m;i++)
     {
         //se cauta B[i] in vectorul A
         ok=0; j=0;
         while(j < n&&!ok)
             if(B[i]==A[j]) ok=1;
                 else j++;
         if(ok==0) D[k2++]=B[i];
     }
     cout < < endl < < "Reuniunea:" < < "D={";
     for(i=0;i < k2;i++)
         cout< < D[i] < < " ";
     cout < < "}";
    }


    intersectia:
    #include< iostream >
    using namespace std;
    int main( )
    {
     int n, m, i, A[100], B[100];
     cout < < "n="; cin > > n;
     for(i=0;i < n;i++)
     {
         cout < < "A[" < < i < < "]=";
         cin > > A[i];
     }
     cout < < "m="; cin > > m;
     for(i=0;i < m;i++)
     {
         cout < < "B[" < < i < < "]=";
         cin > > B[i];
     }
     cout < < "A={";
     for(i=0;i < n;i++)
         cout < < A[i] < < " ";
     cout < < "}";
     cout < < endl;
     cout < < "B={";
     for(i=0;i < m;i++)
         cout < < B[i] < < " ";
     cout < < "}";
     int k1=0, j, ok, C[100];
     for(i=0;i < n;i++)
     {
         //se cauta A[i] in vectorul B
         ok=0; j=0;
         while(j < m&&!ok )
           if(A[i]==B[j]) ok=1;
                else
                  j++;
         if( ok) C[k1++]=A[i];
     }
     cout < < endl;
     cout < < "Intersectia: " < < "C={";
     for(i=0;i < k1;i++)
         cout < < C[i] < < " ";
     cout < < "}";
    }

    Sponsored content

    View previous topic View next topic Back to top  Message [Page 1 of 1]

    Permissions in this forum:
    You cannot reply to topics in this forum