#include <iostream>
using namespace std;
int main()
{
cout<<"output = Mikroskil" <<endl;
cout<<"m=1,";
cout<<"i=2,";
cout<<"r=1,";
cout<<"o=1,";
cout<<"s=1,";
cout<<"k=2,";
cout<<"l=\n\n";
system ("pause");
}
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
main()
{
char teks[255];
int i,j,pjg;
printf("Input Kalimat : ");
gets(teks);
pjg=strlen(teks);
for (i=0;i<pjg;i++)
{
if(i==0 || i==pjg-1)
printf("%c",toupper(teks[i]));
else
printf("%c",tolower(teks[i]));
}
printf("\n");
for(i=0;i<pjg-2;i++)
{
for(j=1;j<pjg;j++)
{
if(j==1)
printf("%c",tolower(teks[j+i]));
else
printf(" ");
}
printf("%c",tolower(teks[pjg-i-2]));
printf("\n");
}
for (i=pjg-1;i>=0;i--)
{
if(i==0 || i==pjg-1)
printf("%c",toupper(teks[i]));
else
printf("%c",tolower(teks[i]));
}
getch();
}
#include <iostream>
#include<conio.h>
using namespace std;
void buang_spasi(char *s);
main()
{
char teks [50];//={'A','B','C'};
cout<<"Input teks : ";
gets(teks);
buang_spasi(teks);
int jumlah = strlen(teks);
int ulang = strlen(teks)*2+1;
int tengah = abs(ulang/2);
int cetak1=0, cetak = 0;
for (int i=0; i<ulang; i++)
{
if (i!=tengah)
{
for (int k=0; k<jumlah; k++)
{
cout<<" ";
}
if (i%2==0)
{
cout<<"*";
}
else
{
cout<<teks[cetak];
cetak++;
}
cout<<endl;
}
else
{
for(int j=0; j<ulang; j++)
{
if (j%2==0)
{
cout<<"*";
}
else
{
cout<<teks[cetak1];
cetak1++;
}
}
cout<<endl;
cetak++;
}
}
system("pause");
}
void buang_spasi(char*s)
{
int a,b;
for(a=0; s[a];)
{
if(s[a]==' ')
for(b=a; s[b];b++)
s[b]=s[b+1];
if(s[a]!=' ') a++;
}
}
using namespace std;
int main()
{
cout<<"output = Mikroskil" <<endl;
cout<<"m=1,";
cout<<"i=2,";
cout<<"r=1,";
cout<<"o=1,";
cout<<"s=1,";
cout<<"k=2,";
cout<<"l=\n\n";
system ("pause");
}
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
main()
{
char teks[255];
int i,j,pjg;
printf("Input Kalimat : ");
gets(teks);
pjg=strlen(teks);
for (i=0;i<pjg;i++)
{
if(i==0 || i==pjg-1)
printf("%c",toupper(teks[i]));
else
printf("%c",tolower(teks[i]));
}
printf("\n");
for(i=0;i<pjg-2;i++)
{
for(j=1;j<pjg;j++)
{
if(j==1)
printf("%c",tolower(teks[j+i]));
else
printf(" ");
}
printf("%c",tolower(teks[pjg-i-2]));
printf("\n");
}
for (i=pjg-1;i>=0;i--)
{
if(i==0 || i==pjg-1)
printf("%c",toupper(teks[i]));
else
printf("%c",tolower(teks[i]));
}
getch();
}
#include <iostream>
#include<conio.h>
using namespace std;
void buang_spasi(char *s);
main()
{
char teks [50];//={'A','B','C'};
cout<<"Input teks : ";
gets(teks);
buang_spasi(teks);
int jumlah = strlen(teks);
int ulang = strlen(teks)*2+1;
int tengah = abs(ulang/2);
int cetak1=0, cetak = 0;
for (int i=0; i<ulang; i++)
{
if (i!=tengah)
{
for (int k=0; k<jumlah; k++)
{
cout<<" ";
}
if (i%2==0)
{
cout<<"*";
}
else
{
cout<<teks[cetak];
cetak++;
}
cout<<endl;
}
else
{
for(int j=0; j<ulang; j++)
{
if (j%2==0)
{
cout<<"*";
}
else
{
cout<<teks[cetak1];
cetak1++;
}
}
cout<<endl;
cetak++;
}
}
system("pause");
}
void buang_spasi(char*s)
{
int a,b;
for(a=0; s[a];)
{
if(s[a]==' ')
for(b=a; s[b];b++)
s[b]=s[b+1];
if(s[a]!=' ') a++;
}
}
Tidak ada komentar:
Posting Komentar