Advertisement
mdlib

Martelo Mjölnir-1

Apr 3rd, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<locale.h>
  4.  
  5. int main(){
  6.    
  7.     setlocale(LC_ALL, "Portuguese");
  8.     char nome[256];
  9.     int fn, tam, i, x, j;
  10.    
  11.     printf("Digite quantos frangos tentarão levantar o martelo Mjölnir: ");
  12.     scanf("%d",&x);
  13.    
  14.     for(i=0;i<x;i++)
  15.     {
  16.     setbuf(stdin, NULL);
  17.    
  18.     printf("Quem ousa desafiar o lendario martelo Mjölnir?!\n");
  19.     gets(nome);
  20.    
  21.     setbuf(stdin, NULL);
  22.    
  23.     tam=strlen(nome);
  24.     fn=-1;
  25.     while(fn<0 || fn>25000){
  26.     printf("\nQual sua força, frangote?!\n");
  27.     scanf("%d", &fn);
  28.     }
  29.  
  30.     if(fn>=5000)
  31.     printf("\nY\n\n");
  32.     else
  33.     printf("\nN\n\n");
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement