该计划有什么问题? :"( [英] whats wrong with this program? :"(

查看:80
本文介绍了该计划有什么问题? :"(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include<stdio.h>
void main()
    {
    int t,u[5],a[5],i,s;
    printf("enter a value of t");
    scanf("%d",&t);
    printf("enter values of u and a");
    for (i=0;i&lt;5;i++)
        {
        scanf("%d",&u[i]);
        scanf("%d",a[i]);
        s=u[i]*t+1/2 a[i]*t*t;
        printf("value of u is %d \n value of a is %d \n value of t is %d \n value of s is %d \n,u[i],a[i],t,s);
        }
    }
    }



显然..当我尝试编译这个程序时...我得到的回报是非函数调用......或语句缺失。请帮助asap。


apparently.. when i try to compile this program.. all i get in return is "non function call"... or "statement missing". please help asap.

推荐答案

#include<stdio.h>
void main()
    {
    int t,u[5],a[5],i,s;
    printf("enter a value of t");
    scanf("%d",&t);
    printf("enter values of u and a");
    for (i=0;i<5;i++)
        {
        scanf("%d",&u[i]);
        scanf("%d",a[i]);
        s=u[i]*t+1/2 a[i]*t*t;
        printf("value of u is %d \n value of a is %d \n value of t is %d \n value of s is %d \n", u[i], a[i], t, s);
        }
    }</stdio.h>



printf 我最后删除了一个}

编译器现在应该更开心了。



我推荐一个专业的文本编辑器,语法着色会显示第一个问题,括号匹配会发现第二个问题。


A quote was missing in printf and I removed a } at the end.
Compiler should be happier now.

I recommend a professional text editor, syntax coloring would have show the first problem and parenthesis matching would have spot the second.


这篇关于该计划有什么问题? :&QUOT;(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆