summaryrefslogblamecommitdiffstats
path: root/inf/zotks/2/sn2.c
blob: d919a95f3ded2cb2bd61f79eb5d9253ea73c303c (plain) (tree)



























                                                         
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
int main (int argc, char ** argv) {
	/* bom pa tko, če nisem sposoben */
	/* NEVER EVER DO THIS */
	char c[128];
	char *p = fgets(c, 128, stdin);
	p++;
	unsigned long long int i = strtoll(c, NULL, 10);
	i++;
	int cast = 0;
label:
	sprintf(c, "%llu", i);
	int k = strlen(c);
	for (int j = 0; j < k; j++) {
		if (c[j] == c[j+1]) {
			i += pow(10, k-(j+2));
			fprintf(stderr, "cd: %llu\n", i);
			// cast = pow(10, k-(j+2));
			// i -= i % cast;
			goto label;
		}
	}
	fprintf(stdout, "%llu\n", i);
	return 0;
}