oleh :
arif zainurrohman
#include <iostream>
#include <stdio.h>
using namespace std;
int main () {
int pil,i,j,m;
char k;
char l='A';
menu :
cout << " xxx {MENU} xxx\n";
cout << " 1. Deret 1 \n";
cout << " 2. Deret 2 \n";
cout << " 3. Exit \n";
cout << "---------------\n";
cout << "Pilihan Anda : "; cin >> pil;
switch (pil) {
case 1:
for (i=5;i>=1;i-=1){
k= 'A';
cout << "\n";
for (j=1;j<=i;j+=1)
if (i%2!=0)
cout << k++ << " ";
else
cout << j << " " ;
}
cout << endl ;
break;
case 2:
m=11;
for (i=1;i<=4;i++) {
cout << "\n";
for (j=1;j<=i;j++)
if (i>=4)
cout << l++ << " ";
else
cout << m++ << " "; }
cout << endl ;
break;
case 3:
break;
default:
cout << "Pilihan hanya 1 atau 2 \n";
goto menu;
}
return 0;
}
Ibu Kota, 23 April 2015
akhukumfillah arifzainurrohman
0 komentar:
Posting Komentar