
Online Judge
文章平均质量分 59
北溟南风起
功夫到家,水到渠成。
展开
-
1001 害死人不偿命的(3n+1)猜想 (15 分)
标题#include<stdio.h>#include<iostream>using namespace std;int main(){ int n,count=0; while(scanf("%d",&n)!=EOF) { while(n!=1) { if(n%2==1) n=(3*n+1)/2; else n=n/2;...原创 2019-02-17 19:56:19 · 227 阅读 · 0 评论 -
1001 害死人不偿命的(3n+1)猜想 (15 分)
标题#include<stdio.h>#include<iostream>using namespace std;int main(){ string str; cin>>str; int num,flag=0,a[1000],t; for(int i=0;i<str.length();i++) { num+=str[i]-...原创 2019-08-12 22:54:24 · 288 阅读 · 0 评论 -
算法训练 P0505
标题#include<stdio.h>#include<iostream>using namespace std;int QiuJC(int t){ int i;int sum=1; for(i=1;i<=t;i++) { sum*=i; while(sum%10==0) { sum/=10; }//消去尾部所有的0 ...原创 2019-02-17 16:19:05 · 489 阅读 · 1 评论 -
基础练习 十进制转十六进制
#include<iostream>using namespace std;int main(){ int n,a,i; char result[10]; cin>>n; if(n==0) printf("%d\n",n); else while(n) { a=n%16; if(a>=0&&a<=9) resu...原创 2019-02-16 19:41:59 · 217 阅读 · 0 评论 -
基础练习 特殊回文数
#include<stdio.h>#include<iostream>using namespace std;int main(){ int n; scanf("%d",&n); for(int i=1;i<=9;i++) { for(int j=0;j<=9;j++) { if(n%2==0) for(int m=0;m...原创 2019-06-21 13:54:16 · 251 阅读 · 0 评论 -
基础练习 十六进制转十进制
#include<bits/stdc++.h>using namespace std;int main(){ int n; scanf("%x",&n); printf("%u",n); return 0;}如果不让用<bits/stdc++.h>岂不是很难受??? ...原创 2019-02-14 17:41:06 · 215 阅读 · 0 评论 -
基础练习 字母图形
#include<stdio.h>char ch[30][30];int main(){ //1、字符数组赋值 int n,m,i,j; scanf("%d%d",&n,&m); for(i=0;i<n;i++) { int t=0; for(j=i;j<m;j++) { ch[i][j]='A'+t; t++; ...原创 2019-02-14 17:26:03 · 657 阅读 · 0 评论 -
基础练习 十六进制转八进制
#include<iostream>#include<string>using namespace std;int main(){ int n; scanf("%d",&n); for(int k=1;k<=n;k++) { string s1,s2;//不用char cin>>s1; for(int ...原创 2019-02-14 17:23:53 · 356 阅读 · 1 评论 -
喷水装置(一)贪心算法
听说这是“贪心算法”的一个简单应用,虽说是简单,但是对我来说,确实不简单。。。说下面说有用的:题目描述: 现有一块草坪,长为20米,宽为2米,要在横中心线上放置半径为Ri的喷水装置,每个喷水装置的效果都会让以它为中心的半径为实数Ri(0<Ri<15)的圆被湿润,这有充足的喷水装置i(1<i<600)个,并且一定能把草坪全部湿润,你要做的是:选择尽量少的喷水...原创 2018-10-04 23:23:40 · 812 阅读 · 0 评论 -
素数判定Prime Decision (Method summary)
程序一、#include<iostream>using namespace std;int main(){ cout<<"please input a number:\n"; int m; cin>>m; for(int i=2;i<m;++i){ if(m%i==0){ cout<<m<<" i原创 2018-06-03 12:52:01 · 816 阅读 · 0 评论 -
10300 - Ecological Premium
Ecological PremiumTime limit : 3.000 secondsGerman farmers are given a premium depending on the conditions at their farmyard 【溢价取决于他们农场的条件】.Imagine the following simplified regulation .you know th...原创 2018-10-24 20:46:29 · 223 阅读 · 0 评论 -
10071 - Back to High School Physics
Back to High School PhysicsTime limit: 3.000 secondsA partical 【[电] 质点;】has inital velocity and accerleration【初速度与加速度 】 .If its velocity after certain time is v then what will its displacement be ...原创 2018-10-24 19:42:27 · 291 阅读 · 0 评论 -
10055 - Hashmat the Brave Warrior
10055 - Hashmat the Brave Warrior Time limit : 3.000 secondsHashmat is a brave warrior【武士,勇士; 军人; 鼓吹战争的人; 】 who with his group of...原创 2018-10-23 17:37:10 · 651 阅读 · 0 评论 -
100-The 3n+1 problem
100 - The 3n+1 problemTime limit 3.000 secondsProblems in Computer Science are often classified as belonging to a certain class of problrms(e.g.,NP,Unsolvable,Recursive). In this problem you will ...原创 2018-10-22 19:09:53 · 418 阅读 · 0 评论 -
Problem 2 :Even Fibonacci numbers
PROBLEM: KEY: NONECODE:#include<iostream>using namespace std;void SumFiBoNci(long int x){ long int sum = 0; long int a = 1, b = 2, middle; while (b < x) { if (b % 2 == 0) ...原创 2018-10-21 14:25:55 · 310 阅读 · 0 评论 -
Multiples of 3 and 5(the answer)
progress: key:nonecode:#include<stdio.h>#include<math.h>#include<iostream>using namespace std;void Sum_X(int x){ int Count=0; for(int i=1;i<x;i++) { if(i%3==...原创 2018-10-21 14:13:13 · 263 阅读 · 0 评论