'return'和'}'之前的期望表达式(花括号)。我尝试更改所有内容,但无法运行

时间:2019-12-04 15:37:08

标签: expected-exception

#include <stdio.h>
int main(){
    char a[5];
    for(char i = 0, i < 5, ++i){
        scanf("%c", &a[i]);
    }
    printf("%c", a[5]);
return 0;
}

我在printf中将a [5]更改为a [i],没有任何改变。 我已经与我在网上发现的那张纸进行了比较(这对ofc有用):

int main() {
  int values[5];
  for(int i = 0; i < 5; ++i) {
     scanf("%d", &values[i]);
  }
  for(int i = 0; i < 5; ++i) {
     printf("%d\n", values[i]);
  }
  return 0;
}

1 个答案:

答案 0 :(得分:0)

您在for循环中使用async而不是半冒号const assert = require("chai").assert; const expect = require("chai").expect; const chai = require("chai"); chai.use(require("chai-datetime")); const agendaConnect = require("./../utils/agenda-connect"); const dbConnect = require("./../utils/db-connect"); describe("Server agenda instance connection", function () { let result; this.timeout(4000); let db; const testDate = new Date(2019, 01, 01); before(async function () { // Seed batchJobs await require("./../batch-jobs-seeder"); // This seeds the database collection db = await dbConnect(); result = await db.collection('batchJobs').findOne(); console.log('result: ', result); // This will be null because script hasn't finished running }); it("should be truthy", function () { assert.isOk(result); }); it("expect environment variable to be 'development'", function () { expect(process.env.NODE_ENV).to.equal('development'); }); it("should have a property 'name'", async function () { expect(result).to.have.property("name"); }); it("should have a property 'type'", function () { expect(result).to.have.property("type"); }); it("should have a property 'nextRunAt'", function () { expect(result).to.have.property("nextRunAt"); }); it("should return a date for the 'nextRunAt' property", function () { assert.typeOf(result.nextRunAt, "date"); }); it("should 'nextRunAt' to be a date after test date", function () { expect(result.nextRunAt).to.afterDate(testDate); }); after(async function () { this.timeout(4000); const agenda = await agendaConnect(); await agenda.purge({}, err => { if (err) { console.log(err); } }); }); });

,

正确用法:

;