热门

最新

红包

立Flag

投票

同城

我的

发布
m0_68036862
斌擎科技
3 年前
truem0_68036862

1024勋章

1024程序员节
CSDN App 扫码分享
分享
2
3
打赏
  • 复制链接
  • 举报
下一条:
#include<stdio.h>//1int main(){ double a,b; char c; scanf("%lf %c %lf =",&a,&c,&b); if(c=='+') printf("%.4f",a+b); else if(c=='-') printf("%.4f",a-b); else if(c=='*') printf("%.4f",a*b); else if((c=='/')&&(b!=0)) printf("%.4f",a/b); else if((c=='/')&&(b==0)) printf("Error!"); return 0; }#include<stdio.h>//3int main(){ int t,n,m,y; scanf("%d", &t); for(int t=0;t<100;t++){ scanf("%d%d", &n, &m); if(m==0) printf("Error!"); else if(m==1) printf("%d",n); else { if(n<m) {if(m%n!=0) printf("%d/%d",n/(m%n),m/(m%n)); else printf("1/%d",m/n); } }}return 0;}
立即登录