#include <stdio.h>
int main()
{
int a,b,c,d,e;
e=(a+b+c+d)/4;
scanf("%d%d%d%d\n",&a,&b,&c,&d);
printf("%f\n",e);
return 0;
}
阅读全部
|
ch12345
贴于 2013年3月27日 22:11
hide
bbsi
//reference : <<Effective C++>> (Third Edition) [美]Scott Meyers 著.侯捷 翻译
/*
泛化copy构造函数
*/
template<class T>
class SmartPtr{
public:
template<typename U>
SmartPtr(const SmartPtr<U>& other)
:heldPtr(other.get()){/**/}
T* get()const{return heldPtr;}
private
......................
阅读全部
|
xyz2013
贴于 2013年3月27日 18:22
hide
bbsi
fftimage=fftshift(fft2(double(I))); % 对条纹图像 I 进行二维傅里叶变换
figure,plot(mat2gray(abs(fftimage(257,:)))); % 显示频谱图
arrinput = ginput; % 鼠标选取高低频之间的波谷位置,点一下,按回车
arrtemp = fftimage(257,:);
[FringeMax,FringeMaxIndex] = max(arrtemp(arrinput(1,1):512));
% 得到从选取点开始向右的最大值(波峰),并记录位置
FringeMaxIndex = round(arrinput(1,1) + FringeMaxIndex - 1);
% 得到 1 级谱(基频)的波峰位置
maxvalue=max(fftimage(257,FringeMaxIndex:512));
% 取出 1 级谱的位置。257 表示第 257 行(中间行,谱的位置)
[m,n]=find(fftimage==maxvalue); % 取出 1 级谱最大值位置
fringe_num=abs(n-m); % 确定条纹个数
......................
阅读全部
|
shdlgjmm2007
贴于 2013年3月27日 14:50
hide
bbsi
#include <stdio.h>
#include <string.h>
int search(char* sourcestr,char* substr)
{
if(substr==NULL) return 0;
int ret=0;
char* begin=sourcestr;
while(*begin!='\0')
{
if(strstr(begin,substr)!=NULL && begin==strstr(begin,substr)) ret++;
begin++;
}
......................
阅读全部
|
wp231957
贴于 2013年3月27日 09:24
hide
bbsi
#define PT 5.5
#define S(x) PT*x*x
#include<stdio.h>
main()
{
int a=1,b=2;
printf("%4.1f\n",S(a+b));
}
阅读全部
|
熙子
贴于 2013年3月26日 20:49
hide
bbsi
1、学生信息管理
问题描述:
已知程序要求管理的学生信息包括:学号(不重复),班级,姓名,年龄,性别,出生日期,地址,电话,E-mail等。设计一程序,完成以下功能:
1) 能从键盘输入学生的信息(增加,输入时需要能检查该学号的学生的记录是否已经存在,出生日期格式是否合法(格式为:YYYY-MM-DD,如2009-01-02))
2) 能从指定的文件中读入学生的信息
3) 能按学号查询学生的信息
4) 能按班级查询学生信息
5) 能删除指定学号的学生信息
6) 能将学生信息保存在指定的文件中
提示:
从文件读入学生信息时,需要先设计好文件的格式,从文件中读取数据后,按照预先设计的格式分析数据,提取学生的信息,读入程序
定义一个日期结构体保存日期,具体信息为:年、月、日
......................
阅读全部
|
唐朝的宇宙
贴于 2013年3月26日 16:39
hide
bbsi
#include<windows.h>
#include<iostream.h>
DWORD WINAPI Fun1Proc(LPVOID lpParameeter);
DWORD WINAPI Fun2Proc(LPVOID lpParameeter);
int tickets=100;
HANDLE g_hEvent;
......................
阅读全部
|
renhongjin
贴于 2013年3月25日 22:14
hide
bbsi
#include <stdio.h>
#include <stdlib.h>
#include <wtypes.h>
#include <winbase.h>
#include <time.h>
#include <conio.h>
struct
{
int choice;
char name[50];
char num[50];
char position[50];
......................
阅读全部
|
面朝大海1994
贴于 2013年3月25日 21:48
hide
bbsi
#include <stdio.h>
//指数运算
_int64 _pow(int base,int p)
{
int i=0;
_int64 ret=1;
if (p==0) return 1;
for(i=1;i<=p;i++)
{
ret=ret*base;
}
......................
阅读全部
|
wp231957
贴于 2013年3月24日 21:11
hide
bbsi
#include<iostream>
#define N 20;
using namespace std;
typedef struct ANode {
int AdjV; //邻接点在顺序表中的位置
int Wn; //权值(用于网,图可省略)
struct ANode *next; //指向下1个邻接点
} *AdjLink; //邻接点存储结构
typedef struct {
int data;//顶点数据元素
......................
阅读全部
|
我是打酱油的
贴于 2013年3月24日 20:33
hide
bbsi