关于#for#的问题,如何解决?

#include
int  main()
{  
    int y,m,d,s,i;
    s=0;
    scanf("%d-%d-%d",&y,&m,&d);
    for(i=m;i<=12;i++){
    if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
            s=s+31;}
        else 
          if(i==4||i==6||i==9||i==11)
            s=s+30;
          else 
            if(i==2){
              if(y%4==0&&y%100!=0||y%400==0){
                s=s+29;
            } else
                s=s+28;
                      }
    s=s-d+1;
    printf("还有%d天",s);
    return 0;
    }
…
    为啥会提示糟糕..
/ data / user /0/coding. yu . ccompiler . new /
18 files / default . c :23:6: error : expected "}"
/
 data / user /0/codingyu. ccompiler . new /
 files / default . c :3:1: note : to match this{
这编译哪块有问题啊

少了个大括号,逻辑也不太对吧

#include<stdio.h>
int  main()
{  
    int y,m,d,s,i;
    s=0;
    scanf("%d-%d-%d",&y,&m,&d);
    for(i=m;i<=12;i++){
    if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
            s=s+31;}
        else 
          if(i==4||i==6||i==9||i==11)
            s=s+30;
          else 
            if(i==2){
              if(y%4==0&&y%100!=0||y%400==0){
                s=s+29;
            } else
                s=s+28;
                      }
                      if(i==m)     s=s-d+1;

    printf("还有%d天",s);
    } 

    return 0;
    }

第一个问题是你少了一个花括号},第二个错误,描述的问题不详

你m都没初始化啊,i=m如果有报错,就是你编程语言比较严谨,建议初始化为零,这算是个好习惯吧