This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class a010 | |
{ | |
private static int factoring(int input) | |
{ | |
for(int i=2;i<input;i++) | |
{ | |
if(input%i==0) | |
return i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void main() | |
{ | |
int T; | |
scanf("%d",&T); | |
for(int n=0;n<T;n++) | |
{ | |
int time,method,count=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
//判斷二進制的進位次數 | |
int carryTime(long int input) | |
{ | |
if(input%2==1) | |
return 0; | |
if(input%4==1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int factor(int input) //取質因數 | |
{ | |
for(int i=2;i<input;i++) | |
{ | |
if(input%i==0) | |
return i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int leap(int input) //閏年判斷 | |
{ | |
if(input%400==0) | |
{ | |
return 1; | |
} | |
else if(input%4==0 && input%100!=0) |