摘要:
#include<iostream>using namespace std;int main(){ int x,y; int i=0; char str[2]; cout<<"Input x and y(x**y):"; cin>>x>>str[1]>>str[2]>>y; int last=1; for(;i<y;i++) { last=last*x%1000; } cout<<"The last three digits of "<<x<< 阅读全文
摘要:
//求某个大于10000的数的约数中,最大的三位数//求某个大于10000的数的约数中,最大的三位数#include<iostream>using namespace std;int main(){int i,integer;cin>>integer;for(i=999;i>=100;i--){if(0==integer%i){cout<<i<<endl;//endl相当于换行break;}}return 0;} 阅读全文
摘要:
//十个评委打分,去最低和最高,求均分#include<stdio.h>int main(){ int score,sum=0,i,ave; int max=-32768,min=32767; for(i=0;i<10;i++) { printf("Input %d score: ",i);//别写成printf("Iput i score:"); scanf("%d",&score); sum+=score; if(max<score) max=score; if(min>score) min= 阅读全文