Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include<string.h>
- #include<math.h>
- #define maxn 1000
- int max ( int a , int b ){
- if ( a > b ) return a ;
- return b ;
- }
- int main()
- {
- int row, col ;
- scanf("%d",&row) ;
- scanf("%d",&col) ;
- char a='a';
- char start = a+max(row,col)-1;
- char temp[maxn]="";
- for (int i=1;i<=row;i++){
- char thisLine[maxn];
- for (int j=0;j<i-1;j++){
- thisLine[j]=temp[j];
- }
- for (int j=i;j<=col;j++){
- thisLine[j-1]=start ;
- }
- for (int j=0;j<strlen(thisLine);j++){
- temp[j]=thisLine[j];
- }
- printf("%s",thisLine);
- printf("\n");
- start--;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment