sivan_iut

Untitled

Feb 18th, 2020
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int n;
  5.     scanf("%d",&n);
  6.     int count=0;
  7.     char s1[1000000];
  8.     char s2[]="Tetrahedron";
  9.     char s3[]="Cube";
  10.     char s4[]="Octahedron";
  11.     char s5[]="Dodecahedron";
  12.     char s6[]="Icosahedron";
  13.     int i;
  14.     for(i=0; i<n; i++)
  15.     {
  16.         scanf("%s",&s1);
  17.         if(strcmp(s1,s2))
  18.             count=count+4;
  19.         if(strcmp(s1,s3))
  20.             count=count+6;
  21.         if(strcmp(s1,s4))
  22.             count=count+8;
  23.         if(strcmp(s1,s5))
  24.             count=count+12;
  25.         if(strcmp(s1,s6))
  26.             count=count+20;
  27.  
  28.     }
  29.  
  30.  
  31.     printf("%d",count);
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.     return 0;
  42. }
Add Comment
Please, Sign In to add comment