Reply to Thread

Post a reply to the thread: tugas baprog

Your Message

Click here to log in

4pA k3paNJ4n64n D4R1 IDGS? (hUrUf I D4n S bes4R)?

 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Rate Thread

You may rate this thread from 1-star (Terrible) to 5-stars (Excellent) if you wish to do so.

Topic Review (Newest First)

  • 01-12-10, 10:52
    andrew_sheva
    Code:
    #include<iostream>
    using namespace std;
    void main()
    {
    	int a,b;
    	for(a=10;a<=20;a++)
    		if (a==10)
    			cout<<" ";
    		else
    			cout<<a<<"\t";
    		for(a=21;a<=30;a++)
    		{
    			for(b=10;b<=20;b++)
    				if(b==10)
    					cout<<a<<" ";
    				else
    					cout<<a*b<<"\t";
    				cout<<endl;
    		}
    }
  • 10-11-10, 18:28
    xdalzJr
    permisiii

    seharusnya pke [CODE] tuh

    nitip include server GTA SAMP ya

    Code:
    #if defined _zcmd_included
    	#endinput
    #endif	
    #define _zcmd_included
    
    #define MAX_FUNC_NAME (32)
    
    #define COMMAND:%1(%2)          \
    			forward cmd_%1(%2); \
    			public cmd_%1(%2)		
    			
    #define CMD:%1(%2) \
    			COMMAND:%1(%2)
    
    #define command(%1,%2,%3) \
    			COMMAND:%1(%2, %3)      
          
    #define cmd(%1,%2,%3) \
    			COMMAND:%1(%2, %3)
    
    #if !defined isnull
    	#define isnull(%1) \
    				((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
    #endif
    
    
    forward OnPlayerCommandReceived(playerid, cmdtext[]); 
    forward OnPlayerCommandPerformed(playerid, cmdtext[], success); 
    
    
    static
    	bool:zcmd_g_HasOPCS = false,
    	bool:zcmd_g_HasOPCE = false;
    
    #if defined FILTERSCRIPT
    
    public OnFilterScriptInit()
    {
    	zcmd_g_HasOPCS = funcidx("OnPlayerCommandReceived") != -1;
    	zcmd_g_HasOPCE = funcidx("OnPlayerCommandPerformed") != -1;
        return CallLocalFunction("zcmd_OnFilterScriptInit", "");
    }
    
    #if defined _ALS_OnFilterScriptInit
        #undef OnFilterScriptInit
    #else
        #define _ALS_OnFilterScriptInit
    #endif
    #define OnFilterScriptInit zcmd_OnFilterScriptInit
    forward zcmd_OnFilterScriptInit();
    
    #else /*not a filterscript*/
    
    public OnGameModeInit()
    {
    	zcmd_g_HasOPCS = funcidx("OnPlayerCommandReceived") != -1;
    	zcmd_g_HasOPCE = funcidx("OnPlayerCommandPerformed") != -1;
    	if (funcidx("zcmd_OnGameModeInit") != -1)
    	{
    		return CallLocalFunction("zcmd_OnGameModeInit", "");
    	}	
    	return 1;
    }
    
    #if defined _ALS_OnGameModeInit
        #undef OnGameModeInit
    #else
        #define _ALS_OnGameModeInit
    #endif
    #define OnGameModeInit zcmd_OnGameModeInit
    forward zcmd_OnGameModeInit();
    
    #endif /*if defined FILTERSCRIPT*/
    
    public OnPlayerCommandText(playerid, cmdtext[])
    {
        if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
        {
            return 1;
        }
        new
            pos,
            funcname[MAX_FUNC_NAME];
        while (cmdtext[++pos] > ' ') 
    	{
    		funcname[pos-1] = tolower(cmdtext[pos]); 
    	}
    	format(funcname, sizeof(funcname), "cmd_%s", funcname);
        while (cmdtext[pos] == ' ') pos++;
    	if (!cmdtext[pos])
    	{
    		if (zcmd_g_HasOPCE)
    		{
    			return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, "\1"));
    		}
    		return CallLocalFunction(funcname, "is", playerid, "\1");	
    	}
    	if (zcmd_g_HasOPCE)
    	{
    		return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, cmdtext[pos]));
    	}
    	return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]);
    }
    
    #if defined _ALS_OnPlayerCommandText
        #undef OnPlayerCommandText
    #else
        #define _ALS_OnPlayerCommandText
    #endif
    #define OnPlayerCommandText zcmd_OnPlayerCommandText
    forward zcmd_OnPlayerCommandText(playerid, cmdtext[]);
  • 10-11-10, 10:38
    andrew_sheva
    #include<iostream>
    #include<fstream>
    void main()
    {
    ofstream tahun;
    tahun.open("KABISAT.TXT");
    int a,n;
    cout<<"Masukkan tahun = ";
    cin>>n;
    a=n%4;
    if(a==0)
    tahun<<"ya , ini kabisat";
    else if(a==1)
    tahun<<"3 tahun lagi";
    else if(a==2)
    tahun<<"2 tahun lagi";
    else if(a==3)
    tahun<<"1 tahun lagi";
    tahun.close();
    }
  • 03-11-10, 10:15
    andrew_sheva
    #include<iostream>
    using namespace std;
    void swap (int x, int y);
    void main()
    {
    int x=5,y=10;
    cout<<"Main before swap , X="<<x<<" , Y= "<<y<<endl;
    swap(x,y);
    cout<<"Main after swap , X= "<<x<<" , Y= "<<y<<endl;
    }
    void swap (int x , int y)
    {
    int temp;
    cout<<"swap before swap , X= "<<x<<" , Y="<<y<<endl;
    temp=x;
    x=y;
    y=temp;
    cout<<"swap after swap, X ="<<x<<" , Y="<<y<<endl;
    }
  • 27-10-10, 10:40
    andrew_sheva
    #include<iostream>
    using namespace std;
    void main()
    {
    int a[3][3],d[3][3],e,f,g;
    cout<<"Inputan Matriks A"<<endl;
    for(e=0;e<=2;e++)
    for(f=0;f<=2;f++)
    {
    cout<<"Baris ke-"<<e+1<<"kolom ke-"<<f+1<<"=";
    cin>>a[e][f];
    }
    cout<<"Inputan Matriks B"<<endl;
    for(e=0;e<=2;e++)
    for(f=0;f<=2;f++)
    {
    cout<<"Baris ke-"<<e+1<<"kolom ke-"<<f+1<<"=";
    cin>>d[e][f];
    }
    for(e=0;e<=2;e++)
    for(f=0;f<=2;f++)
    cout<<"\nMenampilkan Matriks C"<<endl;
    for(e=0;e<=2;e++)
    {
    cout<<"|\t";
    for(f=0;f<=2;f++)
    cout<<a[e][f]+d[e][f]<<"\t";cout<<"|"<<endl;
    }
    cout<<"Matriks c"<<endl;
    }


    matriks jumlah
  • 27-10-10, 10:38
    andrew_sheva
    #include<iostream>
    using namespace std;
    void main()
    {
    int a[3][3],d[3][3],e,f,g;
    cout<<"Inputan Matriks A"<<endl;
    for(e=0;e<=2;e++)
    for(f=0;f<=2;f++)
    {
    cout<<"Baris ke-"<<e+1<<"kolom ke-"<<f+1<<"=";
    cin>>a[e][f];
    }
    cout<<"Inputan Matriks B"<<endl;
    for(e=0;e<=2;e++)
    for(f=0;f<=2;f++)
    {
    cout<<"Baris ke-"<<e+1<<"kolom ke-"<<f+1<<"=";
    cin>>d[e][f];
    }
    for(e=0;e<=2;e++)
    for(f=0;f<=2;f++)
    cout<<"\nMenampilkan Matriks C"<<endl;
    for(e=0;e<=2;e++)
    {
    cout<<"|\t";
    for(f=0;f<=2;f++)
    cout<<a[e][f]+d[e][f]<<"\t";cout<<"|"<<endl;
    }
    cout<<"Matriks c"<<endl;
    }


    matriks jumlah
  • 06-10-10, 12:30
    andrew_sheva
    #include<iostream.h>
    void main()
    {
    int a,b,n;
    char c;
    c='A';
    cout<<"masukkan angka: ";
    cin>>n;

    for(a=1;a<=n;a++)
    {
    for( b=n;b>=a;b--)
    cout<<" ";
    for( b=1;b<=a;b++)
    {
    cout<<b;

    }
    b=a-1;
    for( b=b;b>=1;b--)
    {
    cout<<b;
    }
    cout<<endl;
    }
    }
  • 05-10-10, 21:02
    andrew_sheva
    #include<iostream.h>
    void main()

    {
    int n,a,b;
    char c='A';
    cin>>n;
    for(a=1;a<=n;a++)
    {

    for(b=n;b>=a;b--)
    cout<<" ";

    for(b=1;b<=2*a-1;b++)
    if(b>=a)
    {
    cout<<c;
    c++;
    }
    else
    {
    cout<<c;
    c--;
    }
    cout<<endl;
    }
    }

    a
    bab
    cbabc dst
  • 29-09-10, 10:45
    andrew_sheva
    tae...gw teknik sipil ada ginian
  • 29-09-10, 10:44
    andrew_sheva
    #include<iostream>
    using namespace std;
    void main()
    {
    int n,a,b;
    char c='a';
    cin>>n;
    for(a=1;a<=n;a++)
    {
    for(b=1;b<=n;b++)
    if ((a==1)||(a==n))
    cout<<"*";
    else if ((b==1)||(b==n))
    cout<<"*";
    else
    cout<<" ";
    cout<<endl;
    }
    }

    kotak
  • 29-09-10, 10:33
    Mello
    ewkoakeowakewao makan tuh codingan
  • 29-09-10, 10:29
    andrew_sheva
    #include<iostream>
    using namespace std;
    void main()
    {
    int n,a,b;
    cin>>n;
    for(a=1;a<=n;a++)
    {
    for(b=n;b>=a;b--)
    cout<<a;
    cout<<endl;
    }
    }

    1111
    222
    33
    4

    #include<iostream>
    using namespace std;
    void main()
    {
    int n,a,b;
    char c='a';
    cin>>n;
    for(a=1;a<=n;a++)
    {
    for(b=n;b>=a;b--)
    {
    cout<<c;
    }
    c=c++;
    cout<<endl;
    }
    }

    aaaaa
    bbbb
    ccc
    dd
    e
  • 22-09-10, 11:15
    andrew_sheva
    #include <iostream>
    using namespace std;
    void main()
    {
    int a,b,n;
    cout<<"masukkan angka: ";
    cin>>n;

    for(a=n;a>=1;a--)
    {
    for(b=1;b<=a;b++)
    {
    cout<<b;
    }
    b=a-1;
    for(b=b;b>=1;b--)
    {
    cout<<b;
    }
    cout<<endl;
    }
    }

    123454321
  • 22-09-10, 10:20
    andrew_sheva
    fibonansi

    #include <iostream>
    using namespace std;
    void main()
    {
    int x=1,y=1,p,i,a;
    cout<<"Masukkan batas deret fibonacci : ";
    cin>>a;
    cout<<x<<" ";
    cout<<y<<" ";
    for(i=0;i<=a-3;i++)
    {
    p=x+y;
    cout<<p<<" ";
    x=y;
    y=p;
    }
    }
  • 22-09-10, 10:17
    andrew_sheva

    tugas baprog

    #include<iostream>
    using namespace std;
    void main()
    {
    int bil, jum, i;
    cout<<"Masukkan bilangan: ";
    cin>>bil;
    jum=0;
    for(i=1; i<=bil; i++)
    if(bil%i==0)
    jum++;
    if (jum==2)
    cout<<"Bilangan tersebut adalah bilangan prima"<<endl;
    else
    cout<<"Bilangan Tersebut Bukan bilangan prima"<<endl;
    }

    prima

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may post attachments
  • You may edit your posts
  •