Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
527 views
in Technique[技术] by (71.8m points)

c++ - Error] expected primary-expression before '=' token

When I run my code on dev,it remind me this error,however i can't find any bug ,so hope someone can tell me what wrong with the code thanks! Here is my code:


#include<iostream>
using  namespace std;
int main(){
int a[12][12];

char c;
cin>>c;
 for (int i = 0; i < 11; ++i)

        for (int j = 0; j < 12; ++j)

            cin >> a[i][j];
double sum=0;
if (c=='S'){
     for (int i = 1; i < =10; ++i)

        for (int j = 12-i; j >=1; --j)

            sum=sum+a[i][j];
            printf("%.1f",sum);
    
    
}

else if(c=='M'){
    
    for (int i = 1; i < =10; ++i)

        for (int j = 12-i; j >=1; --j)

            sum=sum+a[i][j];
            printf("%.1f",sum/66);   
}
      
}
question from:https://stackoverflow.com/questions/65861576/error-expected-primary-expression-before-token

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...