// cbai18.cpp : Defines the entry point for the console application.
// CODE DUNG NV
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
int kthoa(char s[])
{
int i=0,dem=0;
while (s[i]!='\0')
{
if (s[i]>='A'&&s[i]<='Z') dem++;
i++;
}
return dem;
}
int _tmain(int argc, _TCHAR* argv[])
{
char s[100];
printf("Nhap vao mot xau ki tu: ");
gets(s);
printf("\nSo ky tu hoa la : %5d",kthoa(s));
getch();
return 0;
}
No comments:
Post a Comment