我需要将此C代码转换为汇编语言代码
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int answer, i;
int right, wrong;
right = 0;
wrong = 0;
for(i =1; i < 11; i = i+1){
printf("What is %d + %d? ", i,i);
scanf( "%d", &answer);
if(answer == i + 1) {
printf("right! ");
right++;
}
else {
printf("Sorry, you're wrong. ");
printf("The answer is %d. ", i + 1);
wrong++;
}
}
printf("You got %d right and %d wrong. ", right, wrong );
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我真的只需要知道如何将变量与汇编语言中的字符串组合在一起,就像上面的C代码一样.我想我可以处理其他一切.有人可以告诉我.我是否必须使用某种参考[]. …
这是错误消息图片的链接:
http://www.flickr.com/photos/76298377@N02/6798897020/in/photostream
这是实际的编程问题.这是3号
这是源代码
#include <iostream>
#include <string>
#include<stdio.h>
using namespace std;
#define numItems 8
#define numSalesP 10
// the product prices
float prices [numItems] = {345.0, 853.0, 471.0, 933.0, 721.0, 663.0, 507.0, 259.00};
// the product numbers
int prodNum [numItems] = {7, 8, 9, 10, 11, 12, 13, 14};
// the salespersons IDs
int salesP [numSalesP] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// the output file pointers …Run Code Online (Sandbox Code Playgroud)