📄 safd.cpp
字号:
// safd.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include"iostream.h"
#include"stdlib.h"
void main()
{
int i;float sum=200.0,high;
float f(int i);
for(i=1;i<=15;i++)
{
sum+=200/f(i)*2;
high=200/f(2);
}
cout<<""<<sum<<endl;
cout<<""<<high<<endl;
//return 0;
}
float f(int i)
{
long int z=1;
int j;
for(j=1;j<=i;j++)
z=z*2;
return z;
/* int t,i,j,a[10]={2900,760,48,25,830,32,86,63,16,70};
int f(int n);
for(i=0;i<=9;i++)
{
for(j=0;j<9-i;j++)
if(a[j]<a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
cout<<"weizhi"<<f(a[j])<<endl;
cout<<"max="<<a[j]<<endl;
}
int f(int n)
{
int low,high,mid;
int a[10]={2900,760,48,25,830,32,86,63,16,70};
low=0;high=9;
while(low<high)
{
mid=(low+high)/2;
if(n==a[mid])
{
return (mid+1);
exit(1);
}
if(n>a[mid])low=mid-1;
if(n<a[mid])high=mid+1;
}*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -