Skip to content

0722_2_Kang040429.c #989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

0722_2_Kang040429.c #989

wants to merge 1 commit into from

Conversation

Kang040429
Copy link

#include <stdio.h>

int main() {

int t = 0;
int max = 0;
int n[100000];

scanf("%d", &t);

for (int i = 0; i < t; i++) {

	scanf("%d", &n[i]);
}

for (int i = 0; i < t; i++) {

	max = n[i];

	for (int j = 0; n[i] != 1; j++) {

		if (n[i] % 2 == 0) {
			n[i] /= 2;
		}
		else {
			n[i]=(n[i] * 3) + 1;
		}

		if (max < n[i]) {
			max = n[i];
		}
	}
	printf("%d\n", max);

}

return 0;

}

@Kang040429 Kang040429 changed the title Create 0722_2_Kang040429.c 0722_2_Kang040429.c Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant