Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main() {
- char ch,*p, a[100]="crocodil", b[100]="hipopotam", dr[100]={}, st[100]={};
- int nr=0,x, cif;
- if((ch>='a' && ch<='z')||(ch>='A' && ch<='Z')) ///isalpha
- /*
- ///Transforma un int --> sir de caractere
- strcpy(a,"");
- cin>>x;
- if(x==0){
- a[0]='0';
- a[1]='\0';
- }
- while(x!=0){
- cif=x%10;
- x=x/10;
- st[0]=cif+'0';
- st[1]='\0';
- strcpy(dr,a);
- strcat(st,dr);
- strcpy(a,st);
- }
- cout<<a;
- /*
- cin.getline(a,100);
- cin.getline(b,100);
- ////Trece Mishu la Sport? da/nu
- p=strtok(a," ,.");
- while(p!=NULL){
- if(p[0]>='0' && p[0]<='9'){
- for(int i=0;i<strlen(p);i++){
- nr=nr*10+p[i]-'0';
- }
- }
- p=strtok(NULL," .");
- }
- if(nr>=50){
- cout<<"Da";
- }
- else{
- cout<<"Nu";
- }
- ///abCd ---> ABCD
- for(int i=0;i<strlen(a);i++){
- if(a[i]>='a' && a[i]<='z'){ ///isalpha(a[i])
- a[i]=a[i]-('a'-'A');
- }
- }
- cout<<a;
- /*
- ///Sa se copieze in sirul a primele 4 caractere din b
- p=strstr(a,b); ///p = a + poz
- if(p!=NULL){
- cout<<"ultima aparitie este pe poz:"<<p-a<<endl;
- cout<<p;
- }
- else{
- cout<<"nu exista";
- }
- //cout<<endl<<"abc";
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement