All pastes #342838 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-06 16:16 UTC
rendered paste body
#include<stdio.h>
#define MAX 10
void fn(int);
char arr[10][4] = {{'.'},{'a','b','c'},{'d','e','f'},{'g','h','i'},{'j','k','l',},{'m','n','o'},{'p','q','r','s'},{'t','u','v'},{'w','x','y','z'}};
int inp[3] = {2,3,4};
int len[10] = {1,3,3,3,3,3,4,3,3,4};
char op[MAX];
int l =3;

int main()
{  
    fn(0);     
    return 0;
}

void fn(int i)
{
 if(i == l)
    {
         op[i] = '\0';
         for(int j=0;j<l;j++)
           printf("%c",op[j]);
         printf(",");
         return;   
    }    
    for(int j=0;j<len[inp[i]];j++)
     {
       op[i] = arr[inp[i]][j];
       fn(i+1);
     }
}