• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
ZhangManlun
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2018年4月25日

stack
摘要: #include <stdio.h>#include <stdlib.h>#include <assert.h>struct elt {struct elt *next;int value;};/** We could make a struct for this,* but it would ha 阅读全文
posted @ 2018-04-25 08:47 ZhangManlun 阅读(154) 评论(0) 推荐(0)
 
 

2018年4月9日

倒三角c语言
摘要: #include <stdio.h>#include <stdlib.h> int main(){ int n,c,a,b; scanf("%d",&n); for(c=n;c>=1;c--) { for(a=0;a<n-c;a++) printf(" "); for( b=2*c-1;b>=1;b 阅读全文
posted @ 2018-04-09 12:12 ZhangManlun 阅读(1174) 评论(0) 推荐(0)
 
c++文件流
摘要: 比cin快很多 #include <iostream>#include<fstream>using namespace std;ifstream fin("aplusb.in");ofstream fout("aplusb.out"); int main(){ int a,b; while(fin> 阅读全文
posted @ 2018-04-09 11:47 ZhangManlun 阅读(152) 评论(0) 推荐(0)
 
重定向与fopen
摘要: //重定向 #include<stdio.h>#define LOCAL#define INF 1000000000int main(){ #ifdef LOCAL freopen("data.in","r",stdin); freopen("data.out","w",stdout); #endi 阅读全文
posted @ 2018-04-09 11:34 ZhangManlun 阅读(436) 评论(0) 推荐(0)
 
阶乘加法and时间
摘要: #include<stdio.h>#include<math.h>#include<time.h>int main(){ const int MOD =1000000; int i,j,n,s=0; scanf("%d",&n); for(i=1;i<=n;i++) { int factorial= 阅读全文
posted @ 2018-04-09 11:19 ZhangManlun 阅读(194) 评论(0) 推荐(0)
 
c中int范围,int字节长度
摘要: #include<stdio.h>#include<limits.h>int main(){ printf("%i %i %d",INT_MAX,INT_MIN,sizeof(int));} 阅读全文
posted @ 2018-04-09 10:41 ZhangManlun 阅读(2779) 评论(0) 推荐(0)
 
 

2018年3月29日

插入排序
摘要: #include "stdafx.h" #include<iostream> using namespace std; void InsertSort(int a[], int n) { for (int j = 1; j < n; j++) { int key = a[j]; //待排序第一个元素 阅读全文
posted @ 2018-03-29 21:04 ZhangManlun 阅读(151) 评论(0) 推荐(0)
 
 

2017年11月29日

openjudge(四)
摘要: 关于switch的应用: #include <iostream>#include<iomanip>using namespace std;int main(){int a,b;char c;cin>>a>>b>>c;switch(c){ case '+':cout<<a+b<<endl;break; 阅读全文
posted @ 2017-11-29 16:59 ZhangManlun 阅读(115) 评论(0) 推荐(0)
 
openjudge(三)
摘要: 已知三角形的三边分别是a、b、c, 先算出周长的一半s=1/2(a+b+c) 则该三角形面积S=根号[s(s-a)(s-b)(s-c)] 这个公式叫海伦——秦九昭公式 证明: 设三角形的三边a、b、c的对角分别为A、B、C, 则根据余弦定理c²=a²+b²-2ab·cosC,得 cosC = (a² 阅读全文
posted @ 2017-11-29 11:32 ZhangManlun 阅读(168) 评论(0) 推荐(0)
 
 

2017年11月24日

openjudge(二)
摘要: 强制类型转换的作用:按照规范输出。 阅读全文
posted @ 2017-11-24 17:19 ZhangManlun 阅读(88) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3