7 Mart 2010 Pazar

C++ ile Mükemmel Sayıları Bulan Kod

//www.ethemsulan.com
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[]){
    int j,b,c;
    b=0;
    cout<<"sayi gir"<<endl;
   
    for(int j=2;j<500;j++){
    for(int i=1;i<j;i++){
            if(j%i==0){
                       b=b+i;
                       }
                       
    }
    if(j==b)
cout<<j<<"sayi Mukemmeldir"<<endl;
            
    else
cout<<j<<"sayi Mukkemel degil"<<endl;
        b=0;
        }    
    system("PAUSE");
    return EXIT_SUCCESS;
}

3 yorum:

  1. bunu nsl yazarız c de
    bir fikriniz var mı
    6. Write a program to input positive integer pairs (x,y) until they are inputted as equal (x=y). Program will do the following: If x>y, it will find and display xy, if x<y it will find and display yx.

    YanıtlaSil
  2. bu kodun aynısını yazdım calısmadı

    YanıtlaSil