第15周阅读程序(5)

news/2024/7/8 6:27:18
/*
*Copyright (c) 2016,烟台大学计算机学院
*All rights reserved.
*文件名称 :
*作 者 : 刘云
*完成日期 : 2016年6月7号
*版 本 号 : v6.0
*
*问题描述 : 阅读程序
*输入描述 :无
*程序输出 :
*/

#include<iterator>
#include<algorithm>
#include<functional>
#include<iostream>
#include<vector>
using namespace std;
class Angle
{
    int degrees;
public:
    Angle(int deg):degrees(deg){}
    int mul(int times)
    {
        return degrees*=times;
    }
};
int main()
{
    int x[]={1,2,4,5,8};
    vector<Angle>va;
    for(int i=10;i<=50;i+=10)
        va.push_back(Angle(i));
    transform(va.begin(),va.end(),x,ostream_iterator<int>(cout," "),mem_fun_ref(&Angle::mul));
    cout<<endl;
    return 0;
}

运行结果:



http://www.niftyadmin.cn/n/3628385.html

相关文章

Java的String字符串内容总结

String--字符串 获取字符串的长度 使用Sring类的length()方法可获取字符串对象的长度&#xff0c;例&#xff1a; str.length(); str代表指定的字符串对象;返回值为返回指定字符串的长度。例&#xff1a; 获取字符串中指定字符的索引位置 String类提供了indexOf()和lastIndexOf…

第15周阅读程序(6)

/* *Copyright (c) 2016,烟台大学计算机学院 *All rights reserved. *文件名称 : *作 者 : 刘云 *完成日期 : 2016年6月7号 *版 本 号 : v6.0 * *问题描述 : 阅读程序 *输入描述 :无 *程序输出 : */#include<string> #include<iostream> #include<map> using…

poj 3208 Apocalypse Someday 数位dp+二分答案

Apocalypse Someday Time Limit: 1000MS Memory Limit: 131072KTotal Submissions: 2203 Accepted: 1110Description The number 666 is considered to be the occult “number of the beast” and is a well used number in all major apocalypse themed blockbuster movies. …

emacs使用笔记

C-h t tutorial [移动基本操作]C-f C-b C-p C-n 前后上下 C-v C-a 行首 C-e行尾C-a 和 C-e 可以将光标移动到"一行"的头部和尾部。M-a 和 M-e 则将光标移动到“一句”的头部和尾部。M-f 向后移动一个单词 M-b 向前移动一个单词C-k 删除 C-v 下一页 M-v 上一页M-< …

red hat Linux配置ip

初次接触Linux &#xff0c;最开始的需要就是上网。配置IP成了学习使用Linux的第一个功课。 1.设置IP地址 查看你使用的IP网卡 ifconfig -a 找到你要使用的网卡 vi/etc/sysconfig/network-scripts/ifcfg-eth0 #IntelCorporation82801BA/BAM/CA/CAMEthernetController DEVICEet…

nyist 14 会场安排问题

以结束时间排序&#xff0c;一开始用了先按照开始时间排序&#xff0c;开始时间相同的按结束时间排&#xff0c;很荣幸的WA了&#xff0c;沉思了一会&#xff0c;用了以结束时间来排序&#xff0c;提交 AC了&#xff0c; 纠结了一会儿&#xff0c;这个。。。。。。。。。。 若以…

2018年9月16号 开学训练日志

昨天没有网络赛就忘了写训练日志。 刚把一道题看明白&#xff0c;昨天下午看了一下午&#xff0c;今天又看了一早上&#xff0c;现在我要按我自己的对数位DP的理解去调试代码&#xff0c;又要开始疯狂的写bug了。

WinForm 之 自定义标题栏的窗体移动

通过标题栏的鼠标事件实现窗体移动&#xff0c;代码如下&#xff1a; bool m_isMouseDown false; //窗体是否移动Point m_mousePos; //记录窗体的位置/// <summary>/// 鼠标按下&#xff0c;开启移动/// </summary>/// <param name"sender"></…