Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
358 B
1
Indexable
Never
#include <stdio.h>


int main(int argc, char *argv[])
{ 
    int m;
    int i = 0;
    int deg1 = 1;
    scanf("%d", &m);
    while (deg1 <= m) {
        deg1 *= 3; 
        i++; 
    }
    printf("%d\n\n", i);
	int k, deg2=1;
    for (k = 1; k <= 15; k++) {
        deg2 *= 3; 
        printf("%3d  %d\n", k, deg2);
    }
    return 0;
}