原创 括號配對問題
#include<iostream> #include<stack> using namespace std; bool judge(string s) { stack<char> S; for(int i=0;i<s.length
原创 特殊的數字
#include <stdio.h> int main() { for(int a=1;a<=9;a++) for(int b=0;b<=9;b++) for(int c=0;c<=9;c++) {
原创 十六進制轉換爲十進制
#include<iostream> #include<string.h> #include<stdio.h> using namespace std; int main() { char s[9]; int t=0,n=1; c
原创 數列排序
#include <iostream> #include<algorithm> using namespace std; int main() { int i,n,a[200]; scanf("%d",&n); for(i=0;i
原创 最大公約數和最小公倍數問題
題目如下:題目描述 Description輸入二個正整數x0,y0(2<=x0<100000,2<=y0<=1000000),求出滿足下列條件的P,Q的個數條件: 1.P,Q是正整數2.要求P,Q以x0爲最大公約數,以y0爲最小公倍數.試
原创 數的計算
1011 數的計算 2001年NOIP全國聯賽普及組 時間限制: 1 s 空間限制: 128000 KB 題目等級 : 白銀 Silver 題解 查看運行結果 題目描述
原创 十進制轉m進制
#include <iostream> #include<stack> using namespace std; int main() { stack<int> s; int n,m,x; cin>>n>>m; while(n)
原创 特殊迴文數
#include <stdio.h> int main() { int n; scanf("%d",&n); for(int a=1;a<=9;a++) for(int b=0;b<=9;b++) for(in
原创 ASCII碼排序
ASCII碼排序 時間限制:3000 ms | 內存限制:65535 KB 難度:2 描述 輸入三個字符(可以重複)後,按各字符的ASCII碼從小到大的順序輸出這三個字符。 輸入 第一行輸入一個數N,表示有N組測試數據。後
原创 斐波那契數列3
1978 Fibonacci數列 3 時間限制: 1 s 空間限制: 64000 KB 題目等級 : 青銅 Bronze 題解 查看運行結果 題目描述 Descripti
原创 素數判定
#include <iostream> #include<math.h> using namespace std; int main() { int n,flag=1; cin>>n; for(int i=2;i<=n/2;i++
原创 多邊形重心問題
多邊形重心問題 時間限制:3000 ms | 內存限制:65535 KB 難度:5 描述 在某個多邊形上,取n個點,這n個點順序給出,按照給出順序將相鄰的點用直線連接, (第一個和最後一個連接),所有線段不和