PAT甲1056 Mice and Rice (25)(25 分)
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
struct mouse
{
int weight;
bool flag;
in...
PAT甲1057 Stack(30 分)
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
#define lowbit(i) ((i)&(-i))
const int maxn=100010...
PAT甲1058 A+B in Hogwarts(20 分)
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
int main()
{
int a1,a2,a3,b1,b2,b3;
int c1=0,...
PAT甲1059 Prime Factors(25 分)
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
using namespace std;
int a;
bool isprime(int x)
{...
PAT甲1060 Are They Equal(25 分)
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
#include <iostream>
using namespace std;
str
PAT甲1062 Talent and Virtue(25 分)
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
#include <vector>
#include <iostream&a
PAT甲1063 Set Similarity(25 分)
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
#include <vector>
#include <set&gt
PAT甲1064 Complete Binary Search Tree(30 分)
#include <string.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
int N;
int CBT[1010],A[1010];
int num=1;
void inorder(int root)
{
if(root>N||root<=0)retu...
PAT甲1065 A+B and C (64bit)(20 分)
#include <string.h>
#include <stdio.h>
using namespace std;
long long A,B,C;
int N;
int main()
{
scanf("%d",&N);
for(int i=0;i<N;i++)
{
scanf("%lld%lld%lld",&...
Objective-C 学习记录-5
2018.7.27
数组的定义和使用
数组分为不可变数组和可变数组
NSArray *array= [NSArray arrayWithObjects:@“xxx”, @“ddd”, mycl, nil];
NSMutableArray<UIView *> *mutableArray;
[mutableArray addObject:view];
a...
Objective-C 学习记录 - 6
2018.7.30
ViewController是视图控制器,它用于管理app中的view,本身并不可见;凡事继承自UIViewController类的对象都是控制器
控件是一个容器,它可以存放其他控件,父子控件之间通过superView和subViews的方法相互访问
IBAction和IBOutlet修饰与控件关联的方法/属性,一些控件既可以关联属性也可以关联方法,一些控件只能关联...
Objective-C 学习记录 - 7
1.只要控件有父控件,就可以移除
[self.view removeFromSuperview];
这行代码在viewDidAppear方法中可以生效,因为此时self.view有父控件UIWindow
2.viewWithTag可以通过tag调用控件,但是效率很低(递归遍历),而且大量使用tag容易混乱,因此应尽量避免使用,尤其是在复杂场景中
2.1当同时有多个同类控件时为了方便区分可...
Objective-C 学习记录 - 8
1.UILabel常用属性:
@property (nonatomic, copy) NSString *text;
//显示的文字
@property (nonatomic, retain) UIFont *font;
//字体
@property (nonatomic, retain) UIColor *color;
//文字颜色
@property (nonatomic) NSTextA...
Objective-C 学习记录 - 9
1.结构体初始化的一种方法:以CGRect为例:
view.frame = (CGRect){{x,y},{width,height}};
view.frame = CGRectMake(x,y,width,height);
//以上两种初始化的设置方式效果完全一样
2.UIImageView的常用初始化方式,initWithFrame、initWithImage
3.UIImageV...
Objective-C 学习记录 - 10
1.播放音乐使用AVFoundation框架(#improt)
播放的内容放到AVPlayerItem实例中,
播放时创建AVPlayer的播放器实例
2.使用NSBundle可以访问自己项目资源包的内容
3.常用的颜色表示方法有32位、24位和12位,其中12位的颜色多用来表示纯色和灰色。位数越少,可表示的颜色越少,但渲染占用的资源也越少。
4.UIButton的Type:
System...
Objective-C 学习记录 - 11
1.监听按钮的点击addTarget方法
[Button addTarget:**)
Target:目标(让谁做事情)
Action:方法(做什么事情)
Events:事件
2.UIButton、UIImageView、UILabel的选择
UIButton特点:
-既能显示文字,又能显示图片
-长按高亮的时候可以切换图片和文字
-可以通过addTarget方法监听点击
UIImageView...
Python中常用的内值方法
1)min(2,4) ## 求最小值 2)max(2,4) ## 求最大值 3)sum(range(1,100,2)) ## 求和 4)枚举:返回索引值和对应的value值 for i, v in enumerate('hello world'): print str(i) + v # 把索引值和对应的value连接起来 print str(i) + "---->" + v 5)zip八两个字符串每个对应的值连接起来,组成元组 a = 'abc' b = '123' for i in zip(
Win10解除网速限制让网速飞起来
Win10隐藏了20%的网速,下面叫你怎么释放它: 1.按Win+R调出运行,输入gpedit.msc点击确定; 2.点击windows设置,右击基于策略Qos,选择高级Qos设置: 3.勾选如图方框,选择级别3: 4.选择管理模板-网络-Qos数据包计划程序,双击限制可保留带宽,进入: 5.选择已启用,带宽限制为0,确定: 尽情享受飞快的网速把!
DSP5509项目之用FFT识别钢琴音调(5)之开始傅里叶变换
1. 首先电脑上下载一个模拟钢琴的软件 2. 研究下钢琴的声音范围27HZ到4000HZ,那么采样频率需要是信号的两倍频率以上,所以建议采样频率是16KHZ。
今日推荐
周排行