A - 发工资咯:)
http://acm.hdu.edu.cn/showproblem.php?pid=2021
#include
#include
int a[6]={100,50,10,5,2,1};
int main()
{
int n;
while(~scanf("%d",&n),n)
{
int *b,sum=0,i,j,k;
b=(int *)calloc(n,sizeof(int));
for(i=0;i
http://acm.hdu.edu.cn/showproblem.php?pid=2022
#include
#include
#include
int n,m,row,col,maxz;
void solve(int a[][100])
{
maxz=a[0][0];row=col=0;
int i,j;
for(i=0;i
C - 求平均成绩
https://vjudge.net/problem/26705/origin
#include
#define N 50
#define M 5
int main()
{
int n,m;
while(~scanf("%d%d",&n,&m))
{
int i,j;
double xueke[6]={0},tongxue[51]={0};
double a[51][6];
for(i=0;i=xueke[j])
{
count++;
}
}
if(count==m)
{
sum++;
}
}
for(i=0;i
D - C语言合法标识符
http://acm.hdu.edu.cn/showproblem.php?pid=2024
#include
#include
#include
int main()
{
int T;
scanf("%d",&T);
getchar();
while(T--)
{
int i,flag=1;
char str[60];
gets(str);
if((str[0]!='_')&&(!isalpha(str[0])))
{
flag=0;
}
for(i=1;i
E - 查找最大元素
http://acm.hdu.edu.cn/showproblem.php?pid=2025
#include
#include
int main()
{
char str[150];
while(~scanf("%s",str))
{
int i,a[100]={0},maxz=str[0];
for(i=0;i
#include
#include
int main()
{
char n,i,str[100];
while(~scanf("%s",str))
{
int ans[100]={0};
char maxz=str[0];
for(i=0;str[i]!='\0';i++)
{
if(maxz
http://acm.hdu.edu.cn/showproblem.php?pid=2026
#include
#include
int main()
{
int i;
char str[150];
while(gets(str))
{
for(i=0;i
#include
#include
#include
http://acm.hdu.edu.cn/showproblem.php?pid=2028
#include
int res(int a,int b)
{
return a%b==0?b:res(b,a%b);
}
int main()
{
int n;
while(~scanf("%d",&n))
{
int i,a,b;
scanf("%d",&a);
for(i=1;i
http://acm.hdu.edu.cn/showproblem.php?pid=2029
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
string a,b;
cin>>a;
b=a;
reverse(a.begin(),a.end());
if(a==b)
cout<<"yes"<
http://acm.hdu.edu.cn/showproblem.php?pid=2030
#include
#include
int main()
{
char a[100001];
int n;
int i;
int s;
scanf("%d",&n);
getchar();
while(n--)
{
gets(a);
s=0;
for(i=0;i
http://acm.hdu.edu.cn/showproblem.php?pid=2031
#include
#include
#include
#include
using namespace std;
int main()
{
int n,k;
while(~scanf("%d%d",&n,&k))
{
char str[16]={'0','1','2','3','4','5','6'
,'7','8','9','A','B','C','D','E','F'};
char ans[1000]={'\0'};
int count=0,i,t=abs(n);
while(t)
{
ans[count++]=str[t%k];
t/=k;
}
if(n<0)
printf("-");
for(i=count-1;i>=0;i--)
{
printf("%c",ans[i]);
}
printf("\n");
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=2032
#include
int ans[35][35]={0};
void solve()
{
int i,j;
for(i=0;i<=31;i++)
{
for(j=0;j<=i;j++)
{
if(j==i||j==0)
ans[i][j]=1;
else
{
ans[i][j]=ans[i-1][j-1]+ans[i-1][j];
}
}
}
}
int main()
{
int n,i,j;
solve();
while(~scanf("%d",&n))
{
for(i=0;i
http://acm.hdu.edu.cn/showproblem.php?pid=2033
#include
#include
int main()
{
int n,i,t;
int shi1,fen1,miao1,shi2,fen2,miao2;
scanf("%d",&t);
while(t--)
{
scanf("%d %d %d %d %d %d",&shi1,&fen1,&miao1,&shi2,&fen2,&miao2);
int shi=0,fen=0,miao=0;
if(miao1+miao2>=60)
{
miao=(miao1+miao2)%60;
fen+=1;
}
else
{
miao=miao1+miao2;
}
if(fen1+fen2+fen>=60)
{
fen=(fen1+fen2+fen)%60;
shi+=1;
}
else
{
fen=fen1+fen2+fen;
}
shi=shi1+shi2+shi;
printf("%d %d %d\n",shi,fen,miao);
}
return 0;
}
N - 人见人爱A-B
#include
#include
#include
using namespace std;
int main()
{
int n,m;
while(~scanf("%d%d",&n,&m),(n||m))
{
int a[120],b[120],c[120],i,j,count=0;
for(i=0;i
O - 人见人爱A^B
http://acm.hdu.edu.cn/showproblem.php?pid=2035
#include
const int mod=1000;
typedef long long ll;
ll qpow(ll a ,ll b)
{
ll ans=1;
while(b)
{
if(b&1)
ans=(ans*a)%mod;
a=(a*a)%mod;
b/=2;
}
return ans;
}
int main()
{
ll n,m;
while(~scanf("%lld%lld",&n,&m),(n||m))
{
printf("%lld\n",qpow(n,m));
}
return 0;
}
P - 改革春风吹满地
http://acm.hdu.edu.cn/showproblem.php?pid=2036
#include
#include
#include
typedef struct point{
double x;
double y;
}p;
int n;
double solve(point a[])
{
double s=0;
int i;
for(i=0;i
http://acm.hdu.edu.cn/showproblem.php?pid=2037
#include
#include
using namespace std;
struct node{
int si;
int fi;
}a[150];
bool cmp(node x,node y)
{
return x.fi
http://acm.hdu.edu.cn/showproblem.php?pid=2039
#include
int main()
{
double a,b,c;
int n;
scanf("%d",&n);
while(n--)
{
scanf("%lf%lf%lf",&a,&b,&c);
if(a+b>c)
{
if(b+c>a)
{
if(a+c>b)
{
printf("YES\n");
continue;
}
else
{
printf("NO\n");
continue;
}
}
else
{
printf("NO\n");
continue;
}
}
else
{
printf("NO\n");
continue;
}
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=2040
#include
typedef long long ll;
int main()
{
ll a,b;
int n;
scanf("%d",&n);
while(n--)
{
scanf("%lld%lld",&a,&b);
ll sum1=0,sum2=0,i;
for(i=1;i