Skip to content

Instantly share code, notes, and snippets.

@FantasticJZI
FantasticJZI / a010.java
Created October 17, 2023 03:35
The problem of factoring.
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;
}
#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;
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
//判斷二進制的進位次數
int carryTime(long int input)
{
if(input%2==1)
return 0;
if(input%4==1)
#include <stdio.h>
#include <stdlib.h>
int factor(int input) //取質因數
{
for(int i=2;i<input;i++)
{
if(input%i==0)
return i;
}
@FantasticJZI
FantasticJZI / a263.c
Last active October 17, 2023 03:39
how many days between two date?
#include <stdio.h>
#include <stdlib.h>
int leap(int input) //閏年判斷
{
if(input%400==0)
{
return 1;
}
else if(input%4==0 && input%100!=0)