Search found 1 match

by masri77
Wed Jul 18, 2012 3:35 am
Forum: Volume 114 (11400-11499)
Topic: 11466 - Largest Prime Divisor
Replies: 29
Views: 21635

Re: 11466 - Largest Prime Divisor

The program generates correct output but gets WA please help ..

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
long long int num, ans;
long long int i;

while (scanf("%lld", &num) && num != 0) {
if (num < 0)
num *= -1;

ans = num;

while (ans % 2 == 0)
ans /= 2;

i ...

Go to advanced search