Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define tam 10
- int main ()
- {
- char gab[tam], resp;
- int num,i,acertos, j;
- printf("GABARITO\n");
- for(i = 0; i < 10; i++)
- {
- printf("Questão %d: ", i+1);
- scanf("%c", &gab[i]);
- }
- printf("NÚMERO DE ALUNOS DA TURMA: ");
- scanf("%d", &num);
- fgetc(stdin);
- for( i = 0; i < num; i++)
- {
- acertos = 0;
- for( j = 0; j < tam; j++)
- {
- printf("Resposta do aluno à questão %d: ", j+1);
- scanf("%c", &resp);
- if( resp == gab[j] )
- {
- acertos++;
- }
- }
- printf("O aluno %d acertou %d questões!", i+1, acertos);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement