专栏首页佳爷的后花媛关于上面c++运行结果

关于上面c++运行结果

Last login: Sat Oct 28 13:38:17 on ttys000
➜  ~ g++ useFunction.cpp
clang: error: no such file or directory: 'useFunction.cpp'
clang: error: no input files
➜  ~ cd Desktop/arithmetic
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
9
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
22
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
9
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
2
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
sum = 5050
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:193:30: error: member reference base type 'const char [12]' is not a
      structure or union
        printf("a[%d] = %d\n".i,a[1]);
               ~~~~~~~~~~~~~~^~
1 error generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:193:30: error: member reference base type 'const char [12]' is not a
      structure or union
        printf("a[%d] = %d\n".i,a[1]);
               ~~~~~~~~~~~~~~^~
1 error generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
a[0] = 3
a[1] = 3
a[2] = 3
a[3] = 3
a[4] = 3
a[5] = 3
a[6] = 3
a[7] = 3
a[8] = 3
a[9] = 3
➜  arithmetic ./a.out
a[0] = 3
a[1] = 3
a[2] = 3
a[3] = 3
a[4] = 3
a[5] = 3
a[6] = 3
a[7] = 3
a[8] = 3
a[9] = 3
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
a[0] = 5
a[1] = 3
a[2] = 2
a[3] = 6
a[4] = 8
a[5] = 4
a[6] = 0
a[7] = 0
a[8] = 0
a[9] = 0
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:202:20: warning: relational comparison result unused
      [-Wunused-comparison]
    for(int i = 1;i<10,i++){
                  ~^~~
useFunction.cpp:202:27: error: expected ';' in 'for' statement specifier
    for(int i = 1;i<10,i++){
                          ^
useFunction.cpp:206:32: error: member reference base type 'int' is not a structure
      or union
        printf("a[%d] = %d\n",i.a[i]);
                              ~^~
1 warning and 2 errors generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
1
a[0] = 1
a[1] = 2
a[2] = 4
a[3] = 8
a[4] = 16
a[5] = 32
a[6] = 64
a[7] = 128
a[8] = 256
a[9] = 512
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
a = 2,b = 1
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:223:5: error: unknown type name 'itn'
    itn a[10] = {3,4,2,5,6,7};
    ^
1 error generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
234567%                                                                             ➜  arithmetic g++ useFunction.cpp
useFunction.cpp:242:29: warning: implicit conversion from 'double' to 'int' changes
      value from 8.4 to 8 [-Wliteral-conversion]
    int a[5][6] = {{3,1,2},{8.4},{},{1,2,3,4,5}};
                           ~^~~
1 warning generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
312000
840000
000000
123450
000000
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:261:13: error: use of undeclared identifier 'j'
        for(j=0;j<3;j++){
            ^
useFunction.cpp:261:17: error: use of undeclared identifier 'j'
        for(j=0;j<3;j++){
                ^
useFunction.cpp:261:21: error: use of undeclared identifier 'j'
        for(j=0;j<3;j++){
                    ^
useFunction.cpp:262:30: error: use of undeclared identifier 'j'
            scanf("%d",&b[i][j]);
                             ^
4 errors generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
123
456
789
147
258
369

789
��������������������������������� Session Restarted ��������������������������������
Last login: Sat Oct 28 13:43:28 on ttys000
➜  ~ ./a.out
zsh: no such file or directory: ./a.out
➜  ~ cd Desktop/arithmetic
➜  arithmetic ./a.out
123
456
789
234
234
234
234
234
^C
➜  arithmetic cd Desktop/arithmetic
cd: no such file or directory: Desktop/arithmetic
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:275:20: error: unexpected ';' before ')'
        printf("\n";)
                   ^
1 error generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
123
123
123
123
123
123
^C
➜  arithmetic ./a.out
12345678909876543
^C
➜  arithmetic ./a.out
1 2 3
4 5 6
7 8 9
1 4 7
2 5 8
3 6 9
2610
61014
101418
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
00000
-1-1-1-1-1
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
^_^
^_^
_^_
^_^
^_^
_^_
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
warning: this program uses gets(), which is unsafe.
WpAiDeRenBuAiWo
QAQ
T_T
WoAiNi
WpAiDeRenBuAiWo
QAQ
T_T
WoAiNi
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
T^T
T^T
➜  arithmetic ./a.out
T_T
T_T
➜  arithmetic ./a.out
hd;akhjfksfhu
hd;
➜  arithmetic ./a.out
owhf a;ijfa
owh
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
warning: this program uses gets(), which is unsafe.
memda
5
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
warning: this program uses gets(), which is unsafe.
Dear Mozart
Canon
str1>str2
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
10
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:373:9: error: assigning to 'int' from incompatible type 'void'
    x = change(x);
        ^~~~~~~~~
1 error generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:373:7: error: invalid operands to binary expression
      ('int' and 'void')
    x ==  change(x);
    ~ ^   ~~~~~~~~~
1 error generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:373:19: error: cannot pass expression of type 'void' to variadic
      function; expected type from format string was 'int'
    printf("%d\n",change(x));
                  ^~~~~~~~~
1 error generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:369:5: error: void function 'change' should not return a value
      [-Wreturn-type]
    return x;
    ^      ~
1 error generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:369:5: error: void function 'change' should not return a value
      [-Wreturn-type]
    return 0;
    ^      ~
1 error generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
10
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
10
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
10
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
10
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:374:5: error: no matching function for call to 'change'
    change(x);
    ^~~~~~
useFunction.cpp:368:6: note: candidate function not viable: requires 0 arguments,
      but 1 was provided
void change(){
     ^
1 error generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
10
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
11
➜  arithmetic ./a.out
11
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
1
3
5
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
4
24
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
233, 233
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
233
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:423:19: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("%d\n",p);
            ~~    ^
1 warning generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:421:9: error: cannot initialize a variable of type 'int' with an
      rvalue of type 'int *'
    int p = &a;
        ^   ~~
1 error generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:423:19: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("%d\n",&a);
            ~~    ^~
1 warning generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:423:17: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("%d",&a);
            ~~  ^~
1 warning generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:423:17: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("%d",&a);
            ~~  ^~
1 warning generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:423:22: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("%d,%d\n",&a ,a);
            ~~       ^~
1 warning generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:423:22: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("%d,%d\n",&a, a);
            ~~       ^~
1 warning generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
1
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
1
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
1 2 3 4 5 6 7 8 9 10
12345678910%                                                                        ➜  arithmetic ./a.out
123456789
10
1 2 3 4 5 6 7 8 9 10
1234567891012345678%                                                                ➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
12345678910%                                                                        ➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
12345678910%                                                                        ➜  arithmetic g++ useFunction.cpp
useFunction.cpp:457:23: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("q = %d\n",q);
                ~~    ^
useFunction.cpp:458:23: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("p = %d\n",p);
                ~~    ^
useFunction.cpp:459:27: warning: format specifies type 'int' but the argument has
      type 'long' [-Wformat]
    printf("q - p = %d\n",q-p);
                    ~~    ^~~
                    %ld
3 warnings generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:457:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("q = %d\n", q);
                ~~     ^
useFunction.cpp:458:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("p = %d\n", p);
                ~~     ^
useFunction.cpp:459:28: warning: format specifies type 'int' but the argument has
      type 'long' [-Wformat]
    printf("q - p = %d\n", q-p);
                    ~~     ^~~
                    %ld
3 warnings generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:457:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("q = %d\n", q);
                ~~     ^
useFunction.cpp:458:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("p = %d\n", p);
                ~~     ^
useFunction.cpp:459:28: warning: format specifies type 'int' but the argument has
      type 'long' [-Wformat]
    printf("q - p = %d\n", q-p);
                    ~~     ^~~
                    %ld
3 warnings generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:457:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("q = %d\n", q);
                ~~     ^
useFunction.cpp:458:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("p = %d\n", p);
                ~~     ^
useFunction.cpp:459:28: warning: format specifies type 'int' but the argument has
      type 'long' [-Wformat]
    printf("q - p = %d\n", q-p);
                    ~~     ^~~
                    %ld
3 warnings generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
233
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:457:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("q = %d\n", q);
                ~~     ^
useFunction.cpp:458:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("p = %d\n", p);
                ~~     ^
useFunction.cpp:459:28: warning: format specifies type 'int' but the argument has
      type 'long' [-Wformat]
    printf("q - p = %d\n", q-p);
                    ~~     ^~~
                    %ld
3 warnings generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:457:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("q = %d\n", q);
                ~~     ^
useFunction.cpp:458:24: warning: format specifies type 'int' but the argument has
      type 'int *' [-Wformat]
    printf("p = %d\n", p);
                ~~     ^
useFunction.cpp:459:28: warning: format specifies type 'int' but the argument has
      type 'long' [-Wformat]
    printf("q - p = %d\n", q-p);
                    ~~     ^~~
                    %ld
3 warnings generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:459:28: warning: format specifies type 'int' but the argument has
      type 'long' [-Wformat]
    printf("q - p = %d\n", q-p);
                    ~~     ^~~
                    %ld
1 warning generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
q = 36
p = 1
q - p = 35
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:459:28: error: indirection requires pointer operand ('long' invalid)
    printf("q - p = %d\n", *(q-p);
                           ^~~~~~
useFunction.cpp:473:5: error: expected '}'
// }
    ^
useFunction.cpp:453:11: note: to match this '{'
int main(){
          ^
2 errors generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:459:28: error: indirection requires pointer operand ('long' invalid)
    printf("q - p = %d\n", *(q-p)};
                           ^~~~~~
useFunction.cpp:473:5: error: expected '}'
// }
    ^
useFunction.cpp:453:11: note: to match this '{'
int main(){
          ^
2 errors generated.
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:459:28: error: indirection requires pointer operand ('long' invalid)
    printf("q - p = %d\n", *(q-p));
                           ^~~~~~
1 error generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
*q = 36
*p = 1
*q - *p = 35
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
a = 2,b = 1
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
1
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
a = 2,b = 1
➜  arithmetic g++ useFunction.cpp
useFunction.cpp:532:1: error: extraneous closing brace ('}')
}
^
1 error generated.
➜  arithmetic g++ useFunction.cpp
➜  arithmetic ./a.out
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • php基础(二)

    输出b,if中的空值赋值给$num,因此if条件必定为false,还有其他一些大同小异的题目,用=和==判断for循环的,只要把握好基本的概念就行了

    仇诺伊
  • 我的PHP常用代码段

    后台进行修改操作时,没有修改图片,再次刷新图片地址为空? 需要在修改函数中加入一个去除空字符串的函数.

    仇诺伊
  • 今日推荐:python-small-examples

    今天推荐的适合python学习者,这个仓库里作者收集了几百个很有趣的示例,都是用 python去实现的。

    仇诺伊
  • MySQL binlog

    【转载请注明出处】:https://cloud.tencent.com/developer/article/1632663

    后端老鸟
  • 两天完成一个小型工程报价系统(三层架构)

    花了两天,整理了一下三层架构,顺便练了一个小型三层架构——工程报价系统。 功能很简单,完成基本的增删改查 搭建项目三层结构 ? 界面的设计以及美化 ...

    用户1161731
  • 旅游一趟没钱了?这款小程序帮你「卖艺」赚外快

    今天,知晓程序(微信号 zxcx0101)就给你推荐一款小程序,不仅能让你的才艺可以大放光彩,还能挣钱赚人气。

    知晓君
  • Oracle merge合并更新函数

    本博客介绍一下Oracle merge合并函数,业务场景:新增数据的时候要先查询数据库是否已经有改数据,有数据就更新数据,没数据才新增数据,这是很常见的业务场景...

    SmileNicky
  • Flash性能分析与调试工具

    flash player(非debugger)版本:http://get.adobe.com/cn/flashplayer/

    meteoric
  • 《笨办法学Python》 第4课手记

    《笨办法学Python》 第4课手记 这节课目的是让你掌握变量,跟C语言非常类似,很简单。 左边是变量名用”=”号给变量赋值。 不同的是我没有看到变量声明,作者...

    Steve Wang
  • 盒模型和box-sizing

    根据 W3C 的规范,元素内容占据的空间是由 width 属性设置的,而内容周围的 padding 和 border 值是另外计算的。不幸的是,IE5.X 和 ...

    FinGet

扫码关注云+社区

领取腾讯云代金券