Wednesday, 24.04.2024, 21:22
Welcome Guest | RSS
Site menu
Login form
Section categories
Search
Calendar
«  April 2024  »
SuMoTuWeThFrSa
 123456
78910111213
14151617181920
21222324252627
282930
Entries archive
Our poll
Rate my site
Total of answers: 6
Statistics

Total online: 1
Guests: 1
Users: 0

Main » Entries archive
#include <iostream>

using namespace std;

int modInverse(int a, int n) {
 int i = n, v = 0, d = 1;
 while (a>0) {
  int t = i/a, x = a;
  a = i % x;
  i = x;
  x = d;
  d = v - t*x;
  v = x;
 }
 v %= n;
 if (v<0) v = (v+n)%n;
 return v;
}

int main()
{
    cout << modInverse(8,16);
    return 0;
}

Category: C++ programs | Views: 510 | Added by: H_Imirzyan | Date: 10.06.2011 | Comments (0)

#include <iostream>

using namespace std;

int shrjum(int tiv) {
    int n=1, t = tiv;
    while ((t/10)!=0) {
        t/=10; n *=10;
        }
    if (tiv>=10)
    return (n*(tiv%10)) + shrjum(tiv/10);
    else
    return (tiv%10);
    }

int main(){
    int x;
    cin>>x;
    cout<<shrjum(x);
    return 0;
}

Category: C++ programs | Views: 519 | Added by: H_Imirzyan | Date: 10.06.2011 | Comments (0)

#include <iostream>

using namespace std;

int main()
{
    int x,a(0);
    cin>>x;
    do{
    a*=10;
    a+=x%10;
    x/=10;
    }while(x>0);
    cout<<a;
    return 0;
}

Category: C++ programs | Views: 486 | Added by: H_Imirzyan | Date: 10.06.2011 | Comments (0)

#include <iostream>

using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    a+=b;
    b=a-b;
    a-=b;
    cout<<endl<<a<<endl<<b;
    return 0;
}

Category: C++ programs | Views: 488 | Added by: H_Imirzyan | Date: 10.06.2011 | Comments (0)

#include <iostream>


using namespace std;

int main()
{
    int a,b;
        cin>>a>>b;
        a^=b;
        b=a^b;
        a^=b;
        cout<<endl<<a<<endl<<b<<endl;
    return 0;
}

Category: C++ programs | Views: 515 | Added by: H_Imirzyan | Date: 10.06.2011 | Comments (0)

#include <iostream>

using namespace std;

int main()
{
int a,b,c,d;
cout <<"enter a,b,c,d"<<endl;
cin >>a>>b>>c>>d;
cout <<(a>b?(a>c?(a>d?a:d):(c>d?c:d)):(b>c?(b>d?b:d):(c>d?c:d)));

return 0;
}

Category: C++ programs | Views: 507 | Added by: H_Imirzyan | Date: 10.06.2011 | Comments (0)

« 1 2 3