What's new

Help Help po sa coding ng dev c

Tnai

Forum Veteran
Elite
Joined
Nov 30, 2016
Posts
1,521
Solutions
8
Reaction
1,182
Points
611
Age
30
pa help po sana ako mga master bayaran ko na lang po kayo ng load salamat
 
post mo lang yung problem at sample code na gawa mo para matulungan ka dito
 
1584150033044.png

eto boss
 

Attachments

1584150625903.png

dapat po kase lalabas agad yung robie roboy is at origin 0,0 kapag nag enter po ako ng 1 kaso hindi po lumabas ..
sa pangalawang enter ko po ng 1 doon po lumabas yung robie roboy is at origin 0,0 hindi ko po alam kung ano pong mali sa code
 

Attachments

eto ts makikitry,
C++:
#include<iostream>
int main(int argc, char * argv[]) {
    int b = 0, 
        org = 0, 
        x = 0,
        y = 0,
        h1 = 0,
        j1 = 0;
        
    while(b != 4){
        printf("Robbie\nChoices: \n");
        printf("1. Origin\n");
        printf("2. Move\n");
        printf("3. Status\n");
        printf("4. Quit\n");
        scanf("%d", &b);
        
        if(b == 1) {
            ++org;
            if(org >= 1)
                printf("Robbie Roboy is at    Origin %d, %d \n" , h1, j1);
        }
        
        else if(b == 2){
            printf("Enter x: ");
            scanf("%d", &x);
            printf("Enter y: ");
            scanf("%d", &y);
            h1 += x;
            j1 += y;
        }
        else if(b == 3){
                printf("Robbie Roboy is at    Origin %d, %d \n" , h1, j1);
        }
    }
}
1584188493402.png
 

Attachments

Similar threads

Back
Top