Skip to content

Instantly share code, notes, and snippets.

@dsouzadyn
Created March 13, 2016 15:21
Show Gist options
  • Save dsouzadyn/b64987de72bce4d45ba8 to your computer and use it in GitHub Desktop.
Save dsouzadyn/b64987de72bce4d45ba8 to your computer and use it in GitHub Desktop.
Pattern solution of last years ut3 paper
#include <stdio.h>
int main(){
int a,b,c,d;
int n = 5;
for(a=1; a<=n; a++){
char x = 'G';
for(b=1; b<=n-a; b++)
printf(" ");
for(d=a; d>=1; d--)
printf("%d",d);
if(a>=2){
for(d=1; d<a; d++){
printf("%c",x);
x++;
}
}
printf("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment