MY name is ruhul amin

ISLAMIC UNIVERSITY OF KUSHTIA

Tuesday, March 19, 2013

diferent type of c++ code

#include <iostream>
#include<cstring>
#include<cstdio>
#define max 1000
using namespace std;
class name
{
    private:
    int la,c;
    char a[max];
    public:
    void member();
    void output();
};
void name::member()
{
    cin.get(a,max);
    la=strlen(a);
}
void name::output()
{
    if((a[0]>=65)&&(a[0]<96))
    cout<<a[0];
    else
    cout<<(char)(a[0]-32);
    for(int i=1;i<la;i++)
    {
        c=0;
        if(a[i]==' ')
        {
        if(((a[i+1]=='a')||(a[i+1]=='A'))&&((a[i+3]=='d')||(a[i+3]=='D'))&&((a[i+2]=='n')||(a[i+2]=='N')))
        c++;
        else
        {
        if((a[i+1]>=65)&&(a[i+1]<96))
        cout<<a[i+1];
        else
        cout<<(char)(a[i+1]-32);
        }
        }
    }
}
int main()
{
     name ob;
    ob.member();
    ob.output();
    return 0;
}

No comments:

Post a Comment