知識、知恵のカタマリ

[PR]コレがGoogleの検索ストーリー

お蔵入り

clip!clip!
Ads By Google

Input value of a: 20
Input value of b: 15
のように実行結果で表すにはどのような文にすればいいですか
。emacsですが


2008-04-24 01:26の質問
この質問は、30日間解決しなかったために自動的に質問が一旦閉じられました。

回答(3)

1.

2008-04-24 01:41:35
とりあえず、Cで
(emacs で書くかどうかは関係ありません)
#include <stdio.h>
#include <stdlib.h>

int main(void){
    int a,b;
    
    printf("Input value to a:");
    scanf("%d",&a);
    printf("Input value to b:");
    scanf("%d",&b);

    printf("Input value of a: %d\n", a);
    printf("Input value of b: %d\n", b);

    return EXIT_SUCCESS;
}
回答レベル : 回答

2.

2008-04-24 01:53:26
C++
#include <iostream>

using namespace std;

int main(void){
    int a,b;
    
      cout << "Input value to a:";
      cin >> a;
      cout << "Input value to b:";
      cin >> b;

      cout << "Input value of a: " << a <<   endl;
      cout << "Input value of b: " << b <<   endl;

    return EXIT_SUCCESS;
}
回答レベル : 回答

3.

2008-04-24 02:08:29
C#
using System;

class SampleProg1{

    static void Main(){
        int a, b;
    
        Console.Write("Input value to a:");
        a=Int32.Parse(Console.ReadLine());
        Console.Write("Input value to b:");
        b=Int32.Parse(Console.ReadLine());
    
        Console.WriteLine("Input value of a: {0}", a);
        Console.WriteLine("Input value of b: {0}", b);
    }
}
回答レベル : 回答
Ads By Google

コメント(2)

2008-04-24 02:58:12

1.emacsを引数なしで起動
2.

(setq a (read-string "a: "))
と入力してからCtr+jを押す
3.aに代入したいものを適当に入力
4.
(message "Input value of a:%s" a)
と入力してからCtr+jを押す

あとはaをbに変えて繰り返すだけ!emacsですがナニカw

#2.  BLUEPIXY
2008-04-24 03:41:51

やっぱ、emacs lisp ですか・
ちょっち考えはしたんですが、
その場合は、カテゴリその他で。
LISPカテゴリないですねぇ。
LISPカテゴリあってもいいのに、やはり方言がきついからですかね。

トラックバック(2)

トラックバックURL: