Skip to content

yantinger/lab1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#include #include int main() { int n; printf("please enter an integer:"); scanf("%d",&n); printf("\n"); while(n>=2)//若n<=1跳出loop { int a; a=(n)%2;//a是n除2的餘數 if(a==0)//a=0表n為偶數 { n=0.5n; printf("%d ",n); } if(a==1)//a=1表n為奇數 {
n=3
n+1; printf("%d ",n);
} } printf("\n"); return 0; }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages