Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //verificati daca 2 cuv rimeaza
- int main ()
- {
- char s[256],s2[256],u2,*u,*q;
- int m,n;
- cin.getline(s,256);
- cin.getline(s2,256);
- m=strlen(s)-2;
- u=s+m;
- n=strlen(s2)-2;
- q=s2+n;
- if (strcmp(u,q)==0)
- cout<<"Rimeaza.";
- else
- cout<<"Nu rimeaza";
- return 0;
- }
- #include<iostream>
- #include<cstring>
- using namespace std;
- //2. se citeste un sir de caractere. precizati daca sirul introdus repr. un numar
- int main ()
- {
- char s[256],s2[256],u2,*u,*q;
- int m,n,ok=0,i;
- cin.getline(s,256);
- for (i=0;i<strlen(s);i++)
- {
- if (s[i]>='0' && s[i]<='9')
- {
- ok=1;
- break;
- }
- }
- if (ok==0)
- cout<<" nu sunt numere";
- else
- cout<<" sunt numere";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement