|
|
|
|
|
摘要:
#include<stdio.h> int main(){ int n,s=1,i; scanf("%d",&n); for(i=1;i<n;i++){ s=(s+1)*2; } printf("%d\n",s); return 0; } 阅读全文
posted @ 2018-10-01 20:47
yogurt_莹
阅读(120)
推荐(0)
编辑
摘要:
#include<stdio.h> int main(){ int a[100],n,i,max=a[0],min=a[0]; float sum,ave; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",a[i]); sum+=a[i]; } for(i= 阅读全文
posted @ 2018-10-01 20:47
yogurt_莹
阅读(152)
推荐(0)
编辑
摘要:
#include<iostream> #include<math.h> using namespace std; int is_prime(int p){ int j,k=0; for(j=2;j<=p;j++){ if(p%j!=0)k++; break; } if(k==0)return 0; 阅读全文
posted @ 2018-10-01 20:46
yogurt_莹
阅读(151)
推荐(0)
编辑
摘要:
#include<stdio.h> int main(){ int m,n,i,a,b,c,s; scanf("%d%d",&m,&n); for(i=m;i<=n;i++){ a=i/100;b=i/10-a*10;c=i%10; s=a*a*a+b*b*b+c*c*c; if(s==i)prin 阅读全文
posted @ 2018-10-01 20:45
yogurt_莹
阅读(122)
推荐(0)
编辑
摘要:
#include<stdio.h> int main(){ int a=1,b=1,n,i; int arr[]={1}; float s=arr[0]; scanf("%d",&n); for(i=1;i<n;i++){ b+=1; arr[i]=a/b; if(i%2!=0) arr[i]=-a 阅读全文
posted @ 2018-10-01 20:45
yogurt_莹
阅读(96)
推荐(0)
编辑
摘要:
#include<iostream> #include<string> using namespace std; int main(){ string name; cout<<"Please input your name:"<<endl; getline(cin,name); if(name.em 阅读全文
posted @ 2018-10-01 14:00
yogurt_莹
阅读(113)
推荐(0)
编辑
摘要:
#include<stdio.h> #include<stdlib.h> #include<math.h> int main(){ int n,m,i,a; float s=n; scanf("%d%d",&n,&m); for(i=1;i<=m;i++){ n=sqrt(n); s+=n; } p 阅读全文
posted @ 2018-10-01 09:52
yogurt_莹
阅读(83)
推荐(0)
编辑
摘要:
#include<stdio.h> int main(){ int a=0,b=0,c=0,n; scanf("%d",&n); int i,f[100]; for(i=0;i<n;i++){ if(f[i]<0)a++; else if(f[i]==0)b++; else c++; } print 阅读全文
posted @ 2018-10-01 09:33
yogurt_莹
阅读(93)
推荐(0)
编辑
摘要:
#include<stdio.h> int main(){ int x=0,y=0,m,n,t,i; scanf("%d%d",&m,&n); if(m>n){ t=m;m=n;n=t; } for(i=m;i<=n;i++){ {if(i%2==0)x+=i*i; else y+=i*i*i; } 阅读全文
posted @ 2018-09-30 22:51
yogurt_莹
阅读(87)
推荐(0)
编辑
摘要:
#include<stdio.h> int main(){ int n,a[10],i,sum=1; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;i<n;i++){ if(a[i]%2!=0) sum*=a[i];} pri 阅读全文
posted @ 2018-09-30 22:45
yogurt_莹
阅读(86)
推荐(0)
编辑
|
|