#include "stdafx.h"
#include<stdio.h>
#include<iostream.h>
#include<ctype.h>
void main()
{
char kalimat[100];
int i, spasi=0;
cout << "\n\t\t - Program Menghitung Kata Dalam Sebuah Kalimat -\n";
cout << "\t==================================================================\n\n";
cout << "\t Masukan Sebuah Kalimat : ";
cin.getline(kalimat, sizeof(kalimat));
for(i=0; kalimat[i]; i++)
{
if(isspace (kalimat[i]) || ispunct (kalimat[i]))
{
spasi++;
}
}
cout << "\t Jumlah Kata = " << spasi +1 << "\n\n";
cout << "\t Kata yang anda masukan adalah : \n";
cout << "\t ";
for(i=0; kalimat[i]; i++)
{
if(isspace (kalimat[i]) || ispunct (kalimat[i]))
{
spasi++;
cout << "\n";
cout << "\t";
}
cout << kalimat[i];
}
cout << "\n";
cout << "\n\n\t\t Terima Kasih Telah Menggunakan Program ini\n\n\n";
cout << "\t\t\t By fadril putra\n";
cout << "\t\t\t From Baubau SULTRA\n";
cout << "\n\t\t\t - Good Bye -\n";
cout << "\t==================================================================\n\n";
cout << "\n";
getchar();
}
Tidak ada komentar:
Posting Komentar