[ create a new paste ] login | about

Link: http://codepad.org/QyZwbQQc    [ raw code | output | fork ]

C++, pasted on May 13:
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
    char SZOV[1001];
    int i,j;
    
    do 
    {
        
        cout<<"adjon meg maximum 1000 karakterbol allo szoveget: "<<endl;
        cin.getline(SZOV,1001);
    }
    while(strlen(SZOV)==0);
    cout<<"kodolas: al=A, fa=B"<<endl;
    for(i=0;i<=strlen(SZOV);i++)
    {
        if(SZOV[i]=='a'&&SZOV[i+1]=='l') 
             {
              SZOV[i]='A';
              for (j=1;j<=strlen(SZOV);j++)
                SZOV[i+j]=SZOV[i+1+j];
             }
        if(SZOV[i]=='f'&&SZOV[i+1]=='a')
             {
              SZOV[i]='B';
              for (j=1;j<=strlen(SZOV);j++)
                SZOV[i+j]=SZOV[i+1+j];
             }                         
    }   
    cout<<endl<<SZOV<<endl;        
    system("pause");
    return 0;
}


Output:
1
2
3
4
5
cc1plus: warnings being treated as errors
In function 'int main()':
Line 18: warning: comparison between signed and unsigned integer expressions
Line 23: warning: comparison between signed and unsigned integer expressions
Line 29: warning: comparison between signed and unsigned integer expressions


Create a new paste based on this one


Comments: