Advertisement
vitormartinotti

Untitled

Jun 18th, 2024
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. int main(){
  4.     char s[101], r[101];
  5.  
  6.     //Ler uma string
  7.     scanf("%s %s", s, r);
  8.  
  9.     //Calcular o tamanho da string
  10.     int tam1 = 0;
  11.     while(s[tam1] != '\0'){
  12.         tam1++;
  13.     }
  14.  
  15.     int tam2 = 0;
  16.     while(r[tam2] != '\0'){
  17.         tam2++;
  18.     }
  19.  
  20.     if(tam1 > tam2) printf("primeira");
  21.     else if (tam1 == tam2) printf("iguais");
  22.     else printf("seguunda");
  23.  
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement