Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #define MAX 601
- int main(){
- char vector[MAX]={};
- char alumno[MAX]={};
- char matriz[3][101]={};
- int num,i,j,k,h,cont,contV,largo1,largo2,largo3;
- scanf("%d",&num);
- for(i=0; i < 3;i++){
- scanf("%101[^\n]",vector);
- cont=0;
- for(j=0; j<MAX; j++){
- if(vector[j] >= 'a' && vector [j] <= 'z'){
- matriz[i][cont] = vector[j];
- cont++;
- }
- if(vector[j] >= 'A' && vector [j] <= 'Z'){
- alumno[cont] = toupper(vector[j]);
- cont++;
- }
- }
- }
- for(i=0; i<num; i++){
- scanf("%101[^\n]",vector);
- cont=0;
- for(j=0; j<MAX; j++){
- if(vector[j] >= 'a' && vector [j] <= 'z'){ //Si el caracter es minuscula se guarda
- alumno[cont] = vector[j];
- cont++;
- }
- if(vector[j] >= 'A' && vector [j] <= 'Z'){ //Si el caracter es mayuscula se aplica toupper()
- alumno[cont] = toupper(vector[j]); //y se guarda en minuscula
- cont++;
- }
- }
- cont = 0;
- for(k = 0; k < 3; k++){
- largo1 = strlen(matriz[k]);
- largo2 = strlen(vector);
- largo3 = 0;
- for(j = 0; j < largo2-largo1; j++){
- for(h = 0; h > largo2; h++){
- contV++;
- }
- if(contV == largo1){
- cont++;
- largo3 += contV;
- }else{
- contV = 0;
- }
- }
- }
- for(j = 0;j<3;j++){
- for(k=0;k<largo1;k++){
- printf("%s",matriz[j][k]);
- }
- }
- /*if(largo3 == largo2){
- printf("ACC\n");
- }else{
- printf("WA\n");
- }*/
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment