Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <time.h>
- int main(){
- int nota[5][3], piornota[3], flag=0, menor;
- printf("Informe as notas dos alunos\n");
- for(int i=0;i<5;i++){
- printf("Aluno %d: ", i+1)/
- scanf("%d %d %d", ¬a[i][0], ¬a[i][1], ¬a[i][2]);
- }
- for(int i=0;i<3;i++){
- for(int j=0;j<5;j++){
- if(nota[j][i]<menor || flag==0){
- menor=nota[j][i];
- piornota[i]=j+1;
- flag=1;
- }
- }
- //printf("piornota: %d\n", piornota[i]);
- flag=0;
- }
- for(int i=0;i<3;i++){
- printf("O aluno %d tirou a nota mais baixa na prova %d\n", piornota[i], i+1);
- }
- /*
- srand(time(NULL));
- int a[10], b[10], c[20], cont=0;
- for(int i=0, j=0;i<10;i++){
- a[i]=rand()%9+1;
- b[i]=rand()%10+10;
- c[j]=a[i];
- j++;
- c[j]=b[i];
- j++;
- }
- printf("Vetor A:");
- for(int i=0;i<10;i++){
- printf("%d ", a[i]);
- }
- printf("\nVetor B:");
- for(int i=0;i<10;i++){
- printf("%d ", b[i]);
- }
- printf("\nVetor C:");
- for(int i=0;i<20;i++){
- printf("%d ", c[i]);
- }
- */
- /*
- int tam, flag=0;
- printf("Digite a quantidade de strings desejadas: ");
- scanf("%d", &tam);
- setbuf(stdin, NULL);
- char string[tam][50], stringaux[50];
- for(int i=0;i<tam;i++){
- printf("String %d: ", i+1);
- gets(string[i]);
- setbuf(stdin, NULL);
- }
- do{
- flag=0;
- for(int i=0;i<tam;i++){
- if(strcasecmp(string[i],string[i+1])>0){
- strcpy(stringaux, string[i]);
- strcpy(string[i], string[i+1]);
- strcpy(string[i+1], stringaux);
- flag=1;
- }
- }
- }while(flag==1);
- system("cls");
- printf("\t\t|Strings em ordem alfabetica|\n\n");
- for(int i=0;i<tam+1;i++){
- printf("%s\n", string[i]);
- }
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement